diff --git a/mod/quiz/view.php b/mod/quiz/view.php index 913037e072a..1912dc7b966 100644 --- a/mod/quiz/view.php +++ b/mod/quiz/view.php @@ -324,7 +324,8 @@ // Work out if the quiz is temporarily unavailable becuase of the delay option. if (!empty($attempts)) { $tempunavailable = ''; - $lastattempttime = end($attempts)->timefinish; + $lastattempt = end($attempts); + $lastattempttime = $lastattempt->timefinish; if ($numattempts == 1 && $quiz->delay1 && $timenow <= $lastattempttime + $quiz->delay1) { $tempunavailable = get_string('temporaryblocked', 'quiz') . ''. userdate($lastattempt + $quiz->delay1). '';