當前位置: 首頁>>代碼示例>>PHP>>正文


PHP lesson::update_effective_access方法代碼示例

本文整理匯總了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;
開發者ID:alanaipe2015,項目名稱:moodle,代碼行數:31,代碼來源:view.php

示例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':
開發者ID:lucaboesch,項目名稱:moodle,代碼行數:31,代碼來源:essay.php


注:本文中的lesson::update_effective_access方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。