]> git.mjollnir.org Git - moodle.git/commitdiff
mod/quiz/review quiz options loaded once per pageload, not once per qn.
authormjollnir_ <mjollnir_>
Tue, 18 Apr 2006 22:47:56 +0000 (22:47 +0000)
committermjollnir_ <mjollnir_>
Tue, 18 Apr 2006 22:47:56 +0000 (22:47 +0000)
Moved loading of quiz review options from loop iterating over each qn to be
displayed, to the top of the pageload.  Should give efficency gains
on quizes with long pages, as well as making the options available
earlier in the process.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz

mod/quiz/review.php

index 3b7ccd31767a8019b92d01d806132f782d0792da..f601d56c5cdabd7bf6fabc33b98eeb2692736fa0 100644 (file)
@@ -38,6 +38,7 @@
 
     require_login($course->id, false, $cm);
     $isteacher = isteacher($course->id);
+    $options = quiz_get_reviewoptions($quiz, $attempt, $isteacher);
     $popup = $isteacher ? 0 : $quiz->popup; // Controls whether this is shown in a javascript-protected window.
 
     if (!$isteacher) {
             $number++; // Just guessing that the missing question would have lenght 1
             continue;
         }
-        $options = quiz_get_reviewoptions($quiz, $attempt, $isteacher);
         $options->validation = QUESTION_EVENTVALIDATE === $states[$i]->event;
         $options->history = ($isteacher and !$attempt->preview) ? 'all' : 'graded';
         // Print the question