Permalink
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...
timhunt committed Jul 26, 2012
1 parent 6975216 commit 40ae563beeb2865258735b7b892f6137d635217f
Showing with 5 additions and 1 deletion.
  1. +5 −1 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 '-';
+ }
}
/**

0 comments on commit 40ae563

Please sign in to comment.