MDL-48962 mod-lesson: maxtime should use a duration form element

This commit is contained in:
Jean-Michel Vedrine 2015-02-02 12:58:42 +01:00
parent dba564c7db
commit a1acc00177
13 changed files with 76 additions and 43 deletions

View file

@ -50,8 +50,8 @@ $PAGE->navbar->add(get_string('continue', 'lesson'));
if (!$canmanage) {
$lesson->displayleft = lesson_displayleftif($lesson);
$timer = $lesson->update_timer();
if ($lesson->timed) {
$timeleft = ($timer->starttime + $lesson->maxtime * 60) - time();
if ($lesson->timelimit) {
$timeleft = ($timer->starttime + $lesson->timelimit) - time();
if ($timeleft <= 0) {
// Out of time
$lesson->add_message(get_string('eolstudentoutoftime', 'lesson'));
@ -157,7 +157,7 @@ if ($canmanage) {
$lesson->add_message(get_string("teacherjumpwarning", "lesson", $warningvars));
}
// Inform teacher that s/he will not see the timer
if ($lesson->timed) {
if ($lesson->timelimit) {
$lesson->add_message(get_string("teachertimerwarning", "lesson"));
}
}