Error with submitting quizzes - regression caused by MDL-15542.

This commit is contained in:
tjhunt 2008-07-22 09:03:51 +00:00
parent b3fac92fdc
commit 5c98fcd402

View file

@ -81,7 +81,11 @@ if ($attemptobj->is_finished()) {
/// Don't log - we will end with a redirect to a page that is logged. /// Don't log - we will end with a redirect to a page that is logged.
/// Get the list of questions needed by this page. /// Get the list of questions needed by this page.
$submittedquestionids = explode(',', $submittedquestionids); if (!empty($submittedquestionids)) {
$submittedquestionids = explode(',', $submittedquestionids);
} else {
$submittedquestionids = array();
}
if ($finishattempt) { if ($finishattempt) {
$questionids = $attemptobj->get_question_ids(); $questionids = $attemptobj->get_question_ids();
} else { } else {
@ -90,7 +94,9 @@ if ($finishattempt) {
/// Load those questions we need, and just the submitted states for now. /// Load those questions we need, and just the submitted states for now.
$attemptobj->load_questions($questionids); $attemptobj->load_questions($questionids);
$attemptobj->load_question_states($submittedquestionids); if (!empty($submittedquestionids)) {
$attemptobj->load_question_states($submittedquestionids);
}
/// Process the responses ///////////////////////////////////////////////// /// Process the responses /////////////////////////////////////////////////
if (!$responses = data_submitted()) { if (!$responses = data_submitted()) {