]> git.mjollnir.org Git - moodle.git/commitdiff
mod/quiz/locallib bugfix get_qn_options now uses more sensible defaults.
authormjollnir_ <mjollnir_>
Tue, 18 Apr 2006 22:54:51 +0000 (22:54 +0000)
committermjollnir_ <mjollnir_>
Tue, 18 Apr 2006 22:54:51 +0000 (22:54 +0000)
Previously get_question_options used options for
after-attempt-while-quiz-open, when called while a attempt was still in
progress.  Changed it to use options for immediately-after-attempt instead.
Credit: Peter Bulmer peterbulmer@catalyst.net.nz

mod/quiz/locallib.php

index 85ede1d000aaa06bfe4ecc891c6e119accfcb14d..5fcea170a4fa1d16f1a21939589f9f75021cf8a1 100644 (file)
@@ -528,7 +528,7 @@ function quiz_get_reviewoptions($quiz, $attempt, $isteacher=false) {
         }
         return $options;
     }
-    if ((time() - $attempt->timefinish) < 120) {
+    if (((time() - $attempt->timefinish) < 120) || $attempt->timefinish==0) {
         $options->responses = ($quiz->review & QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_RESPONSES) ? 1 : 0;
         $options->scores = ($quiz->review & QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_SCORES) ? 1 : 0;
         $options->feedback = ($quiz->review & QUIZ_REVIEW_IMMEDIATELY & QUIZ_REVIEW_FEEDBACK) ? 1 : 0;