Merge branch 'wip-MDL-57464-master' of git://github.com/abgreeve/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 2 Jan 2017 11:16:27 +0000 (11:16 +0000)
committerDan Poltawski <dan@moodle.com>
Mon, 2 Jan 2017 11:16:27 +0000 (11:16 +0000)
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) {