MDL-24140 Each attempt builds on last setting was being ingored in one place.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 2 Nov 2010 19:12:21 +0000 (19:12 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 2 Nov 2010 19:12:21 +0000 (19:12 +0000)
The code was behaving as if it was always true.

mod/quiz/startattempt.php

index c6f54c7..145ed5f 100644 (file)
@@ -114,6 +114,9 @@ $quizobj->preload_questions();
 $quizobj->load_questions();
 
 /// Create initial states for all questions in this quiz.
+if (!$quiz->attemptonlast) {
+    $lastattemptid = false;
+}
 if (!$states = get_question_states($quizobj->get_questions(), $quizobj->get_quiz(), $attempt, $lastattemptid)) {
     print_error('cannotrestore', 'quiz');
 }