From 5c98fcd402198b442250f37950e36ef101125b02 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 22 Jul 2008 09:03:51 +0000 Subject: [PATCH] Error with submitting quizzes - regression caused by MDL-15542. --- mod/quiz/processattempt.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mod/quiz/processattempt.php b/mod/quiz/processattempt.php index b63c011e09..bf86e505c1 100644 --- a/mod/quiz/processattempt.php +++ b/mod/quiz/processattempt.php @@ -81,7 +81,11 @@ if ($attemptobj->is_finished()) { /// Don't log - we will end with a redirect to a page that is logged. /// Get the list of questions needed by this page. -$submittedquestionids = explode(',', $submittedquestionids); +if (!empty($submittedquestionids)) { + $submittedquestionids = explode(',', $submittedquestionids); +} else { + $submittedquestionids = array(); +} if ($finishattempt) { $questionids = $attemptobj->get_question_ids(); } else { @@ -90,7 +94,9 @@ if ($finishattempt) { /// Load those questions we need, and just the submitted states for now. $attemptobj->load_questions($questionids); -$attemptobj->load_question_states($submittedquestionids); +if (!empty($submittedquestionids)) { + $attemptobj->load_question_states($submittedquestionids); +} /// Process the responses ///////////////////////////////////////////////// if (!$responses = data_submitted()) { -- 2.39.5