Permalink
Browse files

MDL-39971 each attempt builds on last broken for previews.

  • Loading branch information...
1 parent ee2e56e commit 1a3e7ab0d3f04427983a3deb78e3e828b8a9e176 @timhunt timhunt committed May 31, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/quiz/startattempt.php
@@ -93,7 +93,7 @@
// And, if the attempt is now no longer in progress, redirect to the appropriate place.
if ($lastattempt->state == quiz_attempt::OVERDUE) {
- redirect($quizobj->summary_url($lastattempt->id));
+ redirect($quizobj->summary_url($lastattempt->id));
} else if ($lastattempt->state != quiz_attempt::IN_PROGRESS) {
redirect($quizobj->review_url($lastattempt->id));
}
@@ -104,6 +104,10 @@
}
} else {
+ while ($lastattempt && $lastattempt->preview) {
+ $lastattempt = array_pop($attempts);
+ }
+
// Get number for the next or unfinished attempt.
if ($lastattempt) {
$attemptnumber = $lastattempt->attempt + 1;

0 comments on commit 1a3e7ab

Please sign in to comment.