本文整理汇总了PHP中workshop::get_examples_for_reviewer方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::get_examples_for_reviewer方法的具体用法?PHP workshop::get_examples_for_reviewer怎么用?PHP workshop::get_examples_for_reviewer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::get_examples_for_reviewer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_examples
/**
* Returns example submissions to be assessed by the owner of the planner
*
* This is here to cache the DB query because the same list is needed later in view.php
*
* @see workshop::get_examples_for_reviewer() for the format of returned value
* @return array
*/
public function get_examples() {
if (is_null($this->examples)) {
$this->examples = $this->workshop->get_examples_for_reviewer($this->userid);
}
return $this->examples;
}
示例2: foreach
// check this flag against the group membership yet
if (groups_get_activity_groupmode($workshop->cm) == SEPARATEGROUPS) {
// user must have accessallgroups or share at least one group with the submission author
if (!has_capability('moodle/site:accessallgroups', $workshop->context)) {
$usersgroups = groups_get_activity_allowed_groups($workshop->cm);
$authorsgroups = groups_get_all_groups($workshop->course->id, $submission->authorid, $workshop->cm->groupingid, 'g.id');
$sharedgroups = array_intersect_key($usersgroups, $authorsgroups);
if (empty($sharedgroups)) {
$canviewall = false;
}
}
}
}
if ($editable and $workshop->useexamples and $workshop->examplesmode == workshop::EXAMPLES_BEFORE_SUBMISSION and !has_capability('mod/workshop:manageexamples', $workshop->context)) {
// check that all required examples have been assessed by the user
$examples = $workshop->get_examples_for_reviewer($USER->id);
foreach ($examples as $exampleid => $example) {
if (is_null($example->grade)) {
$editable = false;
break;
}
}
}
$edit = ($editable and $edit);
$seenaspublished = false;
// is the submission seen as a published submission?
if ($submission->id and ($ownsubmission or $canviewall or $isreviewer)) {
// ok you can go
} elseif ($submission->id and $ispublished) {
// ok you can go
$seenaspublished = true;
示例3: foreach
}
// check that all required examples have been assessed by the user
if ($assessmenteditable and $workshop->useexamples and $workshop->examplesmode == workshop::EXAMPLES_BEFORE_ASSESSMENT
and !has_capability('mod/workshop:manageexamples', $workshop->context)) {
// the reviewer must have submitted their own submission
$reviewersubmission = $workshop->get_submission_by_author($assessment->reviewerid);
if (!$reviewersubmission) {
// no money, no love
$assessmenteditable = false;
echo $output->header();
echo $output->heading(get_string('exampleneedsubmission', 'workshop'), 2);
echo $output->footer();
exit;
} else {
$examples = $workshop->get_examples_for_reviewer($assessment->reviewerid);
foreach ($examples as $exampleid => $example) {
if (is_null($example->grade)) {
$assessmenteditable = false;
echo $output->header();
echo $output->heading(get_string('exampleneedassessed', 'workshop'), 2);
echo $output->footer();
exit;
}
}
}
}
// load the grading strategy logic
$strategy = $workshop->grading_strategy_instance();