From fb2371cea7b49a2a89205145ecd527069d9f6000 Mon Sep 17 00:00:00 2001 From: michaelpenne Date: Wed, 29 Jun 2005 18:11:01 +0000 Subject: [PATCH] FIXED: at End of Lesson with review on produced two warnings. Now they are gone --- mod/lesson/view.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/lesson/view.php b/mod/lesson/view.php index a411232423d..ec586a5bea5 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -1104,7 +1104,9 @@ // look at the attempt records to find the first QUESTION page that the user answered, then use that page id // to pass to view again. This is slick cause it wont call the empty($pageid) code // $ntries is decremented above - $attempts = get_records_select("lesson_attempts", "lessonid = $lesson->id AND userid = $USER->id AND retry = $ntries", "timeseen"); + if (!$attempts = get_records_select("lesson_attempts", "lessonid = $lesson->id AND userid = $USER->id AND retry = $ntries", "timeseen")) { + $attempts = array(); + } $firstattempt = current($attempts); $pageid = $firstattempt->pageid; // IF the student wishes to review, need to know the last question page that the student answered. This will help to make