From 8f2f1d4761e4240c1c308cc4d5590abc995cac78 Mon Sep 17 00:00:00 2001 From: mark-nielsen Date: Sun, 10 Sep 2006 18:50:59 +0000 Subject: [PATCH] Fixed display bug for branch tables and moved message setting to the bottom of continue.php to prevent double message setting when a redirect is called. --- mod/lesson/action/continue.php | 24 ++++++++++++------------ mod/lesson/viewstart.html | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mod/lesson/action/continue.php b/mod/lesson/action/continue.php index abeb6d4d5e..f05d9e875c 100644 --- a/mod/lesson/action/continue.php +++ b/mod/lesson/action/continue.php @@ -9,13 +9,6 @@ if (!has_capability('mod/lesson:manage', $context)) { $lesson->displayleft = lesson_displayleftif($lesson); } - - // This is the warning msg for teachers to inform them that cluster and unseen does not work while logged in as a teacher - if(has_capability('mod/lesson:manage', $context) and lesson_display_teacher_warning($lesson->id)) { - $warningvars->cluster = get_string("clusterjump", "lesson"); - $warningvars->unseen = get_string("unseenpageinbranch", "lesson"); - lesson_set_message(get_string("teacherjumpwarning", "lesson", $warningvars)); - } // This is the code updates the lesson time for a timed test // get time information for this user @@ -46,11 +39,6 @@ error("Error: could not update lesson_timer table"); } } - - // Inform teacher that s/he will not see the timer - if ($lesson->timed and has_capability('mod/lesson:manage', $context)) { - lesson_set_message(get_string("teachertimerwarning", "lesson")); - } // record answer (if necessary) and show response (if none say if answer is correct or not) $pageid = required_param('pageid', PARAM_INT); @@ -768,6 +756,18 @@ } } +/// Set Messages + + // This is the warning msg for teachers to inform them that cluster and unseen does not work while logged in as a teacher + if(has_capability('mod/lesson:manage', $context) and lesson_display_teacher_warning($lesson->id)) { + $warningvars->cluster = get_string("clusterjump", "lesson"); + $warningvars->unseen = get_string("unseenpageinbranch", "lesson"); + lesson_set_message(get_string("teacherjumpwarning", "lesson", $warningvars)); + } + // Inform teacher that s/he will not see the timer + if ($lesson->timed and has_capability('mod/lesson:manage', $context)) { + lesson_set_message(get_string("teachertimerwarning", "lesson")); + } // Report attempts remaining if ($attemptsremaining != 0) { lesson_set_message(get_string('attemptsremaining', 'lesson', $attemptsremaining)); diff --git a/mod/lesson/viewstart.html b/mod/lesson/viewstart.html index 9824ddf130..8d24354625 100644 --- a/mod/lesson/viewstart.html +++ b/mod/lesson/viewstart.html @@ -34,7 +34,7 @@ if ($lesson->displayleft) { } // End if ($lesson->displayleft) ?> - + displayleft) { ?> @@ -44,7 +44,7 @@ if ($lesson->displayleft) { slideshow && $page->qtype == LESSON_BRANCHTABLE) { // Starts the slideshow div ?> -
+
-- 2.39.5