From 608ed9800d3f8f7ef69667f287057e457a6bbe71 Mon Sep 17 00:00:00 2001 From: kaipe Date: Mon, 11 Aug 2003 12:37:54 +0000 Subject: [PATCH] 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. --- mod/quiz/attempt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.5