MDL-31775 lesson: fix undefined variable warnings
authorDan Poltawski <dan@moodle.com>
Tue, 27 Mar 2012 12:01:06 +0000 (20:01 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 27 Mar 2012 12:01:06 +0000 (20:01 +0800)
mod/lesson/view.php

index c274104..5beec57 100644 (file)
@@ -193,7 +193,7 @@ if (empty($pageid)) {
 
     // if there are any questions have been answered correctly in this attempt
     $corrrectattempts = $lesson->get_attempts($retries, true);
-    if ($corrrectattempts>0) {
+    if (!empty($corrrectattempts)) {
         $attempt = end($corrrectattempts);
         $jumpto = $DB->get_field('lesson_answers', 'jumpto', array('id' => $attempt->answerid));
         // convert the jumpto to a proper page id