Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 1a3e7ab0d3f04427983a3deb78e3e828b8a9e176 1 parent ee2e56e
@timhunt timhunt authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/quiz/startattempt.php
View
6 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;
Please sign in to comment.
Something went wrong with that request. Please try again.