From: mark-nielsen Date: Sat, 29 Dec 2007 22:48:48 +0000 (+0000) Subject: Merging fixes for MDL-12383 and MDL-12605 from MOODLE_19_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4c99e342d2c19f76f3ebdd720f4a595ecbc326ca;p=moodle.git Merging fixes for MDL-12383 and MDL-12605 from MOODLE_19_STABLE --- diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 5f43117b56..3243160def 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -446,14 +446,17 @@ if(has_capability('mod/lesson:manage', $context)) { lesson_set_message(get_string('teachertimerwarning', 'lesson')); } else { - if ((($timer->starttime + $lesson->maxtime * 60) - time()) <= 0) { + $timeleft = ($timer->starttime + $lesson->maxtime * 60) - time(); + + if ($timeleft <= 0) { + // Out of time lesson_set_message(get_string('eolstudentoutoftime', 'lesson')); - redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=".LESSON_EOL."&outoftime=normal", get_string("outoftime", "lesson")); - } - // update clock when viewing a new page... no special treatment - if ((($timer->starttime + $lesson->maxtime * 60) - time()) < 60) { + redirect("$CFG->wwwroot/mod/lesson/view.php?id=$cm->id&pageid=".LESSON_EOL."&outoftime=normal"); + die; // Shouldn't be reached, but make sure + } else if ($timeleft < 60) { + // One minute warning lesson_set_message(get_string('studentoneminwarning', 'lesson')); - } + } } } @@ -648,7 +651,6 @@ break; case LESSON_MATCHING : - echo ''; // don't suffle answers (could be an option??) foreach ($answers as $answer) { // get all the response @@ -689,7 +691,7 @@ } } } - echo '
'; + echo ''; print_simple_box_end(); lesson_print_submit_link(get_string('pleasematchtheabovepairs', 'lesson'), 'answerform'); break;