Permalink
Browse files

Fixes a very rare glitch with attempt numbers that I've seen on one

site and could not find the cause for
  • Loading branch information...
1 parent cc03ed4 commit 7e406f7840e667b1521a1623ba55e4367b8b1950 moodler committed Jul 27, 2004
Showing with 5 additions and 6 deletions.
  1. +5 −6 mod/quiz/lib.php
View
@@ -1773,13 +1773,12 @@ 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
-
$attempt->sumgrades = $result->sumgrades;
$attempt->timefinish = time();
$attempt->timemodified = time();

0 comments on commit 7e406f7

Please sign in to comment.