本文整理汇总了PHP中lesson_display_teacher_warning函数的典型用法代码示例。如果您正苦于以下问题:PHP lesson_display_teacher_warning函数的具体用法?PHP lesson_display_teacher_warning怎么用?PHP lesson_display_teacher_warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lesson_display_teacher_warning函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
$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: lesson_cluster_jump
// 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") . ')');