]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fix from stable
authormoodler <moodler>
Tue, 27 Jul 2004 13:19:12 +0000 (13:19 +0000)
committermoodler <moodler>
Tue, 27 Jul 2004 13:19:12 +0000 (13:19 +0000)
mod/quiz/lib.php

index 7e5c2ca9be53686565d4fe5e9faf4c0a21f0c008..52d7e86e06fdce8c1ecb32f7c11b64c1a7cbb18a 100644 (file)
@@ -1575,10 +1575,10 @@ function quiz_save_attempt($quiz, $questions, $result, $attemptnum) {
         return false;
     }
 
-    if ($attempt->attempt != $attemptnum) {  // Double check.
-        notify("Number of this attempt is different to the unfinished one!");
-        return false;
-    }
+    // Not usually necessary, but there's some sort of very rare glitch 
+    // I've seen where the number wasn't already the same.  In these cases
+    // We upgrade the database to match the attemptnum we calculated
+    $attempt->attempt = $attemptnum;
 
     // Now let's complete this record and save it