$result->newpageid = LESSON_EOL;
        } else {
            $result->newpageid = $page->nextpageid;
        }
    } else {
        $result->newpageid = $lesson->cluster_jump($page->id);
    }
}
if ($result->nodefaultresponse) {
    // Don't display feedback
    redirect(new moodle_url('/mod/lesson/view.php', array('id' => $cm->id, 'pageid' => $result->newpageid)));
}
/// Set Messages
if ($canmanage) {
    // This is the warning msg for teachers to inform them that cluster and unseen does not work while logged in as a teacher
    if (lesson_display_teacher_warning($lesson)) {
        $warningvars = new stdClass();
        $warningvars->cluster = get_string("clusterjump", "lesson");
        $warningvars->unseen = get_string("unseenpageinbranch", "lesson");
        $lesson->add_message(get_string("teacherjumpwarning", "lesson", $warningvars));
    }
    // Inform teacher that s/he will not see the timer
    if ($lesson->timed) {
        $lesson->add_message(get_string("teachertimerwarning", "lesson"));
    }
}
// Report attempts remaining
if ($result->attemptsremaining != 0 && !$lesson->review && !$reviewmode) {
    $lesson->add_message(get_string('attemptsremaining', 'lesson', $result->attemptsremaining));
}
// Report if max attempts reached
Пример #2
0
            // if teacher, go to next page
            $newpageid = LESSON_EOL;
        } else {
            $newpageid = $page->nextpageid;
        }
    } else {
        $newpageid = lesson_cluster_jump($lesson->id, $USER->id, $pageid);
    }
}
if ($nodefaultresponse) {
    // Don't display feedback
    redirect("{$CFG->wwwroot}/mod/lesson/view.php?id={$cm->id}&pageid={$newpageid}");
}
/// 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));
}
// Report if max attempts reached
if ($maxattemptsreached != 0) {
    lesson_set_message('(' . get_string("maximumnumberofattemptsreached", "lesson") . ')');