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


PHP workshop::check_group_membership方法代碼示例

本文整理匯總了PHP中workshop::check_group_membership方法的典型用法代碼示例。如果您正苦於以下問題:PHP workshop::check_group_membership方法的具體用法?PHP workshop::check_group_membership怎麽用?PHP workshop::check_group_membership使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在workshop的用法示例。


在下文中一共展示了workshop::check_group_membership方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: workshop

require_login($course, false, $cm);
if (isguestuser()) {
    print_error('guestsarenotallowed');
}
$workshop = new workshop($workshop, $cm, $course);
$PAGE->set_url($workshop->assess_url($assessment->id));
$PAGE->set_title($workshop->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('assessingsubmission', 'workshop'));
$canviewallassessments = has_capability('mod/workshop:viewallassessments', $workshop->context);
$canviewallsubmissions = has_capability('mod/workshop:viewallsubmissions', $workshop->context);
$cansetassessmentweight = has_capability('mod/workshop:allocate', $workshop->context);
$canoverridegrades = has_capability('mod/workshop:overridegrades', $workshop->context);
$isreviewer = $USER->id == $assessment->reviewerid;
$isauthor = $USER->id == $submission->authorid;
$canviewallsubmissions = $canviewallsubmissions && $workshop->check_group_membership($submission->authorid);
if ($isreviewer or $isauthor or $canviewallassessments and $canviewallsubmissions) {
    // such a user can continue
} else {
    print_error('nopermissions', 'error', $workshop->view_url(), 'view this assessment');
}
if ($isauthor and !$isreviewer and !$canviewallassessments and $workshop->phase != workshop::PHASE_CLOSED) {
    // authors can see assessments of their work at the end of workshop only
    print_error('nopermissions', 'error', $workshop->view_url(), 'view assessment of own work before workshop is closed');
}
// only the reviewer is allowed to modify the assessment
if ($isreviewer and $workshop->assessing_allowed($USER->id)) {
    $assessmenteditable = true;
} else {
    $assessmenteditable = false;
}
開發者ID:dg711,項目名稱:moodle,代碼行數:31,代碼來源:assessment.php


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