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.
This commit is contained in:
@@ -152,7 +152,11 @@ abstract class quiz_attempts_report_table extends table_sql {
|
||||
* @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 '-';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user