Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-34532 quiz reports: error when showing users without attempts.

We were not checking if attempt state was null before trying to convert it to a string.
  • Loading branch information...
commit 40ae563beeb2865258735b7b892f6137d635217f 1 parent 6975216
@timhunt timhunt authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/quiz/report/attemptsreport_table.php
View
6 mod/quiz/report/attemptsreport_table.php
@@ -152,7 +152,11 @@ public function col_fullname($attempt) {
* @return string HTML content to go inside the td.
*/
public function col_state($attempt) {
- return quiz_attempt::state_name($attempt->state);
+ if (!is_null($attempt->attempt)) {
+ return quiz_attempt::state_name($attempt->state);
+ } else {
+ return '-';
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.