Permalink
Browse files

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.
  • Loading branch information...
1 parent c571f3f commit 608ed9800d3f8f7ef69667f287057e457a6bbe71 kaipe committed Aug 11, 2003
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 608ed98

Please sign in to comment.