本文整理汇总了PHP中workshop::excompare_url方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::excompare_url方法的具体用法?PHP workshop::excompare_url怎么用?PHP workshop::excompare_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::excompare_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
}
}
if ($canmanage) {
// Remember the last one who edited the reference assessment.
$coredata->reviewerid = $USER->id;
}
// Update the assessment data if there is something other than just the 'id'.
if (count((array)$coredata) > 1 ) {
$DB->update_record('workshop_assessments', $coredata);
}
if (!is_null($rawgrade) and isset($data->saveandclose)) {
if ($canmanage) {
redirect($workshop->view_url());
} else {
redirect($workshop->excompare_url($example->id, $assessment->id));
}
} else {
// either it is not possible to calculate the $rawgrade
// or the reviewer has chosen "Save and continue"
redirect($PAGE->url);
}
}
// output starts here
$output = $PAGE->get_renderer('mod_workshop'); // workshop renderer
echo $output->header();
echo $output->heading(get_string('assessedexample', 'workshop'), 2);
$example = $workshop->get_example_by_id($example->id); // reload so can be passed to the renderer
echo $output->render($workshop->prepare_example_submission(($example)));
示例2: array
$cmid = required_param('cmid', PARAM_INT);
// course module id
$sid = required_param('sid', PARAM_INT);
// example submission id
$aid = required_param('aid', PARAM_INT);
// the user's assessment id
$cm = get_coursemodule_from_id('workshop', $cmid, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
require_login($course, false, $cm);
if (isguestuser()) {
print_error('guestsarenotallowed');
}
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
$workshop = new workshop($workshop, $cm, $course);
$strategy = $workshop->grading_strategy_instance();
$PAGE->set_url($workshop->excompare_url($sid, $aid));
$example = $workshop->get_example_by_id($sid);
$assessment = $workshop->get_assessment_by_id($aid);
if ($assessment->submissionid != $example->id) {
print_error('invalidarguments');
}
$mformassessment = $strategy->get_assessment_form($PAGE->url, 'assessment', $assessment, false);
if ($refasid = $DB->get_field('workshop_assessments', 'id', array('submissionid' => $example->id, 'weight' => 1))) {
$reference = $workshop->get_assessment_by_id($refasid);
$mformreference = $strategy->get_assessment_form($PAGE->url, 'assessment', $reference, false);
}
$canmanage = has_capability('mod/workshop:manageexamples', $workshop->context);
$isreviewer = $USER->id == $assessment->reviewerid;
if ($canmanage) {
// ok you can go
} elseif ($isreviewer and $workshop->assessing_examples_allowed()) {