]> git.mjollnir.org Git - moodle.git/commitdiff
Debug
authorkaipe <kaipe>
Mon, 11 Aug 2003 12:37:54 +0000 (12:37 +0000)
committerkaipe <kaipe>
Mon, 11 Aug 2003 12:37:54 +0000 (12:37 +0000)
This fix rids warnings that used to come when a student for the first time attempts a quiz with the option "Each attempt builds on the last" = Yes (attemptonlast).
Now the option is not in effect when a student attempts a quiz for the first time, i.e. when there is no last attempt to build on.

mod/quiz/attempt.php

index 2f882388517c9c820212a2a7468b69a1b4e62b95..0c56224f7340099b73f995e5d1aeb9dfcdadb1fa 100644 (file)
 
     $result = NULL;     // Default
     $questions = NULL;  // Default
-    if ($quiz->attemptonlast) {
+    if ($quiz->attemptonlast && !empty($attempts)) {
         $latestfinishedattempt->attempt = 0;
         foreach ($attempts as $attempt) {
             if ($attempt->timefinish