本文整理汇总了PHP中lesson::update_effective_access方法的典型用法代码示例。如果您正苦于以下问题:PHP lesson::update_effective_access方法的具体用法?PHP lesson::update_effective_access怎么用?PHP lesson::update_effective_access使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lesson
的用法示例。
在下文中一共展示了lesson::update_effective_access方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$id = required_param('id', PARAM_INT);
// Course Module ID
$pageid = optional_param('pageid', null, PARAM_INT);
// Lesson Page ID
$edit = optional_param('edit', -1, PARAM_BOOL);
$userpassword = optional_param('userpassword', '', PARAM_RAW);
$backtocourse = optional_param('backtocourse', false, PARAM_RAW);
$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST));
require_login($course, false, $cm);
if ($backtocourse) {
redirect(new moodle_url('/course/view.php', array('id' => $course->id)));
}
// Apply overrides.
$lesson->update_effective_access($USER->id);
// Mark as viewed
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
$url = new moodle_url('/mod/lesson/view.php', array('id' => $id));
if ($pageid !== null) {
$url->param('pageid', $pageid);
}
$PAGE->set_url($url);
$context = context_module::instance($cm->id);
$canmanage = has_capability('mod/lesson:manage', $context);
$lessonoutput = $PAGE->get_renderer('mod_lesson');
$reviewmode = false;
$userhasgrade = $DB->count_records("lesson_grades", array("lessonid" => $lesson->id, "userid" => $USER->id));
if ($userhasgrade && !$lesson->retake) {
$reviewmode = true;
示例2: stdClass
}
$PAGE->set_url($url);
$currentgroup = groups_get_activity_group($cm, true);
$attempt = new stdClass();
$user = new stdClass();
$attemptid = optional_param('attemptid', 0, PARAM_INT);
$formattextdefoptions = new stdClass();
$formattextdefoptions->noclean = true;
$formattextdefoptions->para = false;
$formattextdefoptions->context = $context;
if ($attemptid > 0) {
$attempt = $DB->get_record('lesson_attempts', array('id' => $attemptid));
$answer = $DB->get_record('lesson_answers', array('lessonid' => $lesson->id, 'pageid' => $attempt->pageid));
$user = $DB->get_record('user', array('id' => $attempt->userid));
// Apply overrides.
$lesson->update_effective_access($user->id);
$scoreoptions = array();
if ($lesson->custom) {
$i = $answer->score;
while ($i >= 0) {
$scoreoptions[$i] = (string) $i;
$i--;
}
} else {
$scoreoptions[0] = get_string('nocredit', 'lesson');
$scoreoptions[1] = get_string('credit', 'lesson');
}
}
/// Handle any preprocessing before header is printed - based on $mode
switch ($mode) {
case 'grade':