From: kaipe Date: Mon, 11 Aug 2003 12:37:54 +0000 (+0000) Subject: Debug X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=608ed9800d3f8f7ef69667f287057e457a6bbe71;p=moodle.git Debug This fix rids warnings that used to come when a student for the first time attempts a quiz with the option "Each attempt builds on the last" = Yes (attemptonlast). Now the option is not in effect when a student attempts a quiz for the first time, i.e. when there is no last attempt to build on. --- diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 2f88238851..0c56224f73 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -193,7 +193,7 @@ $result = NULL; // Default $questions = NULL; // Default - if ($quiz->attemptonlast) { + if ($quiz->attemptonlast && !empty($attempts)) { $latestfinishedattempt->attempt = 0; foreach ($attempts as $attempt) { if ($attempt->timefinish