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

This commit is contained in:
Tim Hunt 2013-05-31 20:24:50 +01:00
parent b6f8a93642
commit 2ed7833790

View file

@ -104,6 +104,10 @@ if ($lastattempt && ($lastattempt->state == quiz_attempt::IN_PROGRESS ||
}
} else {
while ($lastattempt && $lastattempt->preview) {
$lastattempt = array_pop($attempts);
}
// Get number for the next or unfinished attempt.
if ($lastattempt) {
$attemptnumber = $lastattempt->attempt + 1;