From a40eaaa28f50ab5413fb665272b8461d56894d83 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 13 Oct 2014 17:32:22 +0100 Subject: [PATCH] MDL-47651 quiz responses: allow for qtypes without responses --- mod/quiz/report/responses/first_or_all_responses_table.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/quiz/report/responses/first_or_all_responses_table.php b/mod/quiz/report/responses/first_or_all_responses_table.php index 1d91655e12f..4a90a08e40e 100644 --- a/mod/quiz/report/responses/first_or_all_responses_table.php +++ b/mod/quiz/report/responses/first_or_all_responses_table.php @@ -132,6 +132,10 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table { */ public function get_summary_after_try($tablerow, $slot) { $qa = $this->get_question_attempt($tablerow->usageid, $slot); + if (!($qa->get_question() instanceof question_manually_gradable)) { + // No responses, and we cannot call summarise_response below. + return null; + } $submissionsteps = $qa->get_steps_with_submitted_response_iterator(); $step = $submissionsteps[$tablerow->try]; if ($step === null) {