diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 870dd46b750..948f3b16ef6 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -48,14 +48,14 @@ if (!defined("LESSON_SHORTANSWER")) { if (!defined("LESSON_TRUEFALSE")) { define("LESSON_TRUEFALSE", "2"); } -if (!defined("LESSON_MULTICHOICE")) { +if (!defined("LESSON_MULTICHOICE")) { // if you change the value of this (WHICH YOU SHOULDNT) then you need to change it in restorelib.php as well define("LESSON_MULTICHOICE", "3"); } if (!defined("LESSON_RANDOM")) { define("LESSON_RANDOM", "4"); } -if (!defined("LESSON_MATCHING")) { - define("LESSON_MATCHING", "5"); +if (!defined("LESSON_MATCHING")) { // if you change the value of this (WHICH YOU SHOULDNT) then you need to change it in restorelib.php as well + define("LESSON_MATCHING", "5"); } if (!defined("LESSON_RANDOMSAMATCH")) { define("LESSON_RANDOMSAMATCH", "6"); @@ -882,26 +882,34 @@ function lesson_is_page_in_cluster($pages, $pageid) { } /*******************************************************************/ -function lesson_print_tree_menu($lessonid, $pageid, $id) { +function lesson_print_tree_menu($lessonid, $pageid, $id, $showpages=false) { // prints the contents of the left menu if(!$pages = get_records_select("lesson_pages", "lessonid = $lessonid")) { error("Error: could not find lesson pages"); } while ($pageid != 0) { - lesson_print_tree_link_menu($pages[$pageid], $id); + lesson_print_tree_link_menu($pages[$pageid], $id, true); $pageid = $pages[$pageid]->nextpageid; } } /*******************************************************************/ -function lesson_print_tree_link_menu($page, $id) { +function lesson_print_tree_link_menu($page, $id, $showpages=false) { // prints the actual link for the left menu if ($page->qtype == LESSON_BRANCHTABLE && !$page->display) { return false; + } elseif ($page->qtype != LESSON_BRANCHTABLE) { + return false; } + /*elseif ($page->qtype != LESSON_BRANCHTABLE && !$showpages) { + return false; + } elseif (!in_array($page->qtype, $LESSON_QUESTION_TYPE)) { + return false; + }*/ + // set up some variables NoticeFix changed whole function $output = ""; $close = false; @@ -910,15 +918,13 @@ function lesson_print_tree_link_menu($page, $id) { if($page->id == $_REQUEST['pageid']) { $close=true; - $output.="