MDL-57464 mod_lesson: fix notice with sub-clusters.
authorAdrian Greeve <adrian@moodle.com>
Tue, 20 Dec 2016 06:39:54 +0000 (14:39 +0800)
committerAdrian Greeve <adrian@moodle.com>
Fri, 23 Dec 2016 03:10:20 +0000 (11:10 +0800)
mod/lesson/pagetypes/endofbranch.php

index c715677..634da76 100644 (file)
@@ -58,7 +58,8 @@ class lesson_page_type_endofbranch extends lesson_page {
 
     public function redirect_to_first_answer($canmanage) {
         global $USER, $PAGE;
-        $answer = array_shift($this->get_answers());
+        $answers = $this->get_answers();
+        $answer = array_shift($answers);
         $jumpto = $answer->jumpto;
         if ($jumpto == LESSON_RANDOMBRANCH) {