MDL-35868: quiz: Use correct attemptnumber when a last attempt exists.
authorTim Lock <tim.lock@netspot.com.au>
Thu, 28 Mar 2013 00:45:23 +0000 (11:15 +1030)
committerDan Poltawski <dan@moodle.com>
Mon, 8 Apr 2013 03:09:04 +0000 (11:09 +0800)
mod/quiz/startattempt.php

index 374db3f..f1f08ca 100644 (file)
@@ -105,7 +105,7 @@ if ($lastattempt && ($lastattempt->state == quiz_attempt::IN_PROGRESS ||
 
 } else {
     // Get number for the next or unfinished attempt.
-    if ($lastattempt && !$lastattempt->preview && !$quizobj->is_preview_user()) {
+    if ($lastattempt) {
         $attemptnumber = $lastattempt->attempt + 1;
     } else {
         $lastattempt = false;