From b7daa75d0861918060eb8180570f820daedadda9 Mon Sep 17 00:00:00 2001 From: michaelpenne Date: Fri, 4 Feb 2005 19:30:19 +0000 Subject: [PATCH] most changes in continue section. Took it out of slideshow. Made some display changes with display left (not style sheet dependent now) --- mod/lesson/lesson.php | 135 +++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 88 deletions(-) diff --git a/mod/lesson/lesson.php b/mod/lesson/lesson.php index 0241fe0520..1258da70b2 100644 --- a/mod/lesson/lesson.php +++ b/mod/lesson/lesson.php @@ -116,9 +116,9 @@ echo "\n"; /// CDC-FLAG /// 6/16/04 echo "\n"; - echo "
"; + echo "
"; echo get_string("arrangebuttonshorizontally", "lesson")."\n"; - echo "
"; + echo "
"; echo get_string("displayinleftmenu", "lesson"); echo "
\n"; echo "\n"; @@ -615,48 +615,33 @@ confirm_sesskey(); - //CDC Chris Berri added this echo call for left menu. must match that in view.php for styles + // left menu code if ($lesson->displayleft) { - echo '
'; - if ($page = get_record_select("lesson_pages", "lessonid = $lesson->id AND prevpageid = 0")) { - // print the pages - echo "
\n"; - echo "id\">\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "
"; - } - echo "
"; //close leftmenu1 - echo "
"; //CDC slidepos - } elseif ($lesson->slideshow) { - echo "
"; - } - /// CDC-FLAG /// Slideshow styles - if($lesson->slideshow) { - echo "
bgcolor; - height: ".$lesson->height."px; - width: ".$lesson->width."px; - overflow: auto; - border: 0px solid #ccc; - padding: 8px; - \">\n"; + if($firstpageid = get_field('lesson_pages', 'id', 'lessonid', $lesson->id, 'prevpageid', 0)) { + echo '
'; + // print the pages + echo "
\n"; + echo "id\">\n"; + echo "\n"; + echo "\n"; + echo "cellheading\" width=\"140px\">"; + echo ""; + echo ""; + echo "
".get_string("lessonmenu", "lesson")."
"; + echo "id\">".get_string("mainmenu", "lesson")."
"; + lesson_print_tree_menu($lesson->id, $firstpageid, $cm->id); + echo "
"; + echo "
"; + echo '
'; + } } - /// CDC-FLAG /// /// CDC-FLAG /// 6/21/04 This is the warning msg for teachers to inform them that cluster and unseen does not work while logged in as a teacher if(isteacher($course->id)) { if (execute_teacherwarning($lesson->id)) { $warningvars->cluster = get_string("clusterjump", "lesson"); $warningvars->unseen = get_string("unseenpageinbranch", "lesson"); - echo "
".get_string("teacherjumpwarning", "lesson", $warningvars)."

"; + echo "

".get_string("teacherjumpwarning", "lesson", $warningvars)."

"; } } /// CDC-FLAG /// @@ -665,7 +650,7 @@ $outoftime = false; if($lesson->timed) { if(isteacher($course->id)) { - echo "
".get_string("teachertimerwarning", "lesson")."
"; + echo "

".get_string("teachertimerwarning", "lesson")."

"; } else { if (!$timer = get_record("lesson_timer", "lessonid", $lesson->id, "userid", $USER->id)) { error("Error: could not find record"); @@ -690,9 +675,9 @@ redirect("view.php?id=$cm->id&action=navigation&pageid=".LESSON_EOL."&outoftime=normal", get_string("outoftime", "lesson")); } if ((($timer->starttime + $lesson->maxtime * 60) - time()) < 60 && !((($timer->starttime + $lesson->maxtime * 60) - time()) < 0)) { - echo "
".get_string("studentoneminwarning", "lesson")."
"; + echo "

".get_string("studentoneminwarning", "lesson")."

"; } elseif (($timer->starttime + $lesson->maxtime * 60) < time()) { - echo "
".get_string("studentoutoftime", "lesson")."
"; + echo "

".get_string("studentoutoftime", "lesson")."

"; $outoftime = true; } unset($newtime); @@ -986,12 +971,13 @@ /// CDC-FLAG /// 6/14/04 -- added responses case LESSON_MATCHING : - if (isset($_POST['response'])) { - $response = optional_param('response'); + if (isset($_POST['response']) && is_array($_POST['response'])) { // only arrays should be submitted + $response = $_POST['response']; } else { $noanswer = true; break; } + if (!$answers = get_records("lesson_answers", "pageid", $pageid, "id")) { error("Continue: No answers found"); } @@ -1146,8 +1132,7 @@ /// CDC-FLAG /// /// CDC-FLAG /// this is called when jumping to random from a branch table - if($newpageid == LESSON_UNSEENBRANCHPAGE) - { + if($newpageid == LESSON_UNSEENBRANCHPAGE) { if (isteacher($course->id)) { $newpageid = LESSON_NEXTPAGE; } else { @@ -1163,6 +1148,7 @@ // no nextpage go to end of lesson $newpageid = LESSON_EOL; } + echo $newpageid; /* CDC-FLAG */ } elseif ($newpageid == LESSON_PREVIOUSPAGE) { $newpageid = $page->prevpageid; } elseif ($newpageid == LESSON_RANDOMPAGE) { @@ -1369,59 +1355,32 @@ $newpageid = lesson_cluster_jump($lesson->id, $USER->id, $pageid); } } - /// CDC-FLAG /// + echo "
\n"; echo "id\">\n"; echo "\n"; echo "\n"; - /// CDC-FLAG /// - if ($lesson->slideshow) { - echo "
"; //Close Mark's big div tag??? - - echo "width\" cellpadding=\"5\" cellspacing=\"5\">
\n"; - if (isset($USER->modattempts[$lesson->id])) { - echo "

". - get_string("savechangesandeol", "lesson")."

". - "

\n"; - echo "

".get_string("or", "lesson")."

". - get_string("continuetoanswer", "lesson")."

\n"; - } - if ($lesson->review && !$correctanswer && !$noanswer) { - echo "

\n"; - echo "

\n"; - } else { - echo "

\n"; - } - echo "
"; + if (isset($USER->modattempts[$lesson->id])) { + echo "

". + get_string("savechangesandeol", "lesson")."

". + "

\n"; + echo "

".get_string("or", "lesson")."

". + get_string("continuetoanswer", "lesson")."

\n"; + } + if ($lesson->review && !$correctanswer && !$noanswer) { + echo "

\n"; + echo "

\n"; } else { - if (isset($USER->modattempts[$lesson->id])) { - echo "

". - get_string("savechangesandeol", "lesson")."

". - "

\n"; - echo "

".get_string("or", "lesson")."

". - get_string("continuetoanswer", "lesson")."

\n"; - } - if ($lesson->review && !$correctanswer && !$noanswer) { - echo "

\n"; - echo "

\n"; - } else { - echo "

\n"; - } + echo "

\n"; } echo "\n"; if ($lesson->displayleft) { - echo "
"; //CDC Chris Berri for styles, closes slidepos. - } elseif ($lesson->slideshow) { echo "
"; } } @@ -1618,14 +1577,14 @@ echo "
\n"; echo "
"; if ($page->layout) { - echo ""; + echo ""; } else { echo ""; } echo get_string("arrangebuttonshorizontally", "lesson")."
\n"; echo "
"; if ($page->display) { - echo "
"; + echo "
"; } else { echo "
"; } -- 2.39.5