本文整理汇总了PHP中workshop::exassess_url方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::exassess_url方法的具体用法?PHP workshop::exassess_url怎么用?PHP workshop::exassess_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::exassess_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
require_once(dirname(__FILE__).'/locallib.php');
$asid = required_param('asid', PARAM_INT); // assessment id
$assessment = $DB->get_record('workshop_assessments', array('id' => $asid), '*', MUST_EXIST);
$example = $DB->get_record('workshop_submissions', array('id' => $assessment->submissionid, 'example' => 1), '*', MUST_EXIST);
$workshop = $DB->get_record('workshop', array('id' => $example->workshopid), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id' => $workshop->course), '*', MUST_EXIST);
$cm = get_coursemodule_from_instance('workshop', $workshop->id, $course->id, false, MUST_EXIST);
require_login($course, false, $cm);
if (isguestuser()) {
print_error('guestsarenotallowed');
}
$workshop = new workshop($workshop, $cm, $course);
$PAGE->set_url($workshop->exassess_url($assessment->id));
$PAGE->set_title($workshop->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('assessingexample', 'workshop'));
$currenttab = 'assessment';
$canmanage = has_capability('mod/workshop:manageexamples', $workshop->context);
$isreviewer = ($USER->id == $assessment->reviewerid);
if ($isreviewer or $canmanage) {
// such a user can continue
} else {
print_error('nopermissions', 'error', $workshop->view_url(), 'assess example submission');
}
// only the reviewer is allowed to modify the assessment
示例2: dirname
*/
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once dirname(__FILE__) . '/locallib.php';
$asid = required_param('asid', PARAM_INT);
// assessment id
$assessment = $DB->get_record('workshop_assessments', array('id' => $asid), '*', MUST_EXIST);
$example = $DB->get_record('workshop_submissions', array('id' => $assessment->submissionid, 'example' => 1), '*', MUST_EXIST);
$workshop = $DB->get_record('workshop', array('id' => $example->workshopid), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id' => $workshop->course), '*', MUST_EXIST);
$cm = get_coursemodule_from_instance('workshop', $workshop->id, $course->id, false, MUST_EXIST);
require_login($course, false, $cm);
if (isguestuser()) {
print_error('guestsarenotallowed');
}
$workshop = new workshop($workshop, $cm, $course);
$PAGE->set_url($workshop->exassess_url($assessment->id));
$PAGE->set_title($workshop->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('assessingexample', 'workshop'));
$currenttab = 'assessment';
$canmanage = has_capability('mod/workshop:manageexamples', $workshop->context);
$isreviewer = $USER->id == $assessment->reviewerid;
if ($isreviewer or $canmanage) {
// such a user can continue
} else {
print_error('nopermissions', 'error', $workshop->view_url(), 'assess example submission');
}
// only the reviewer is allowed to modify the assessment
if ($canmanage and $assessment->weight == 1 or $isreviewer and $workshop->assessing_examples_allowed()) {
$assessmenteditable = true;
} else {
示例3: redirect
} else {
print_error('nopermissions', 'error', $workshop->view_url(), 'view or manage example submission');
}
if ($id and $delete and $confirm and $canmanage) {
require_sesskey();
$workshop->delete_submission($example);
redirect($workshop->view_url());
}
if ($id and $assess and $canmanage) {
// reference assessment of an example is the assessment with the weight = 1. There should be just one
// such assessment
require_sesskey();
if (!$refasid) {
$refasid = $workshop->add_allocation($example, $USER->id, 1);
}
redirect($workshop->exassess_url($refasid));
}
if ($id and $assess and $canassess) {
// training assessment of an example is the assessment with the weight = 0
require_sesskey();
$asid = $DB->get_field('workshop_assessments', 'id', array('submissionid' => $example->id, 'weight' => 0, 'reviewerid' => $USER->id));
if (!$asid) {
$asid = $workshop->add_allocation($example, $USER->id, 0);
}
if ($asid == workshop::ALLOCATION_EXISTS) {
// the training assessment of the example was not found but the allocation already
// exists. this probably means that the user is the author of the reference assessment.
echo $output->header();
echo $output->box(get_string('assessmentreferenceconflict', 'workshop'));
echo $output->continue_button($workshop->view_url());
echo $output->footer();
示例4: array
$PAGE->set_title($workshop->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('examplecomparing', 'workshop'));
// Output starts here
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $output->heading(format_string($workshop->name));
echo $output->heading(get_string('assessedexample', 'workshop'), 3);
echo $output->render($workshop->prepare_example_submission($example));
// if the reference assessment is available, display it
if (!empty($mformreference)) {
$options = array('showreviewer' => false, 'showauthor' => false, 'showform' => true);
$reference = $workshop->prepare_example_reference_assessment($reference, $mformreference, $options);
$reference->title = get_string('assessmentreference', 'workshop');
if ($canmanage) {
$reference->url = $workshop->exassess_url($reference->id);
}
echo $output->render($reference);
}
if ($isreviewer) {
$options = array('showreviewer' => true, 'showauthor' => false, 'showform' => true);
$assessment = $workshop->prepare_example_assessment($assessment, $mformassessment, $options);
$assessment->title = get_string('assessmentbyyourself', 'workshop');
if ($workshop->assessing_examples_allowed()) {
$assessment->add_action(new moodle_url($workshop->exsubmission_url($example->id), array('assess' => 'on', 'sesskey' => sesskey())), get_string('reassess', 'workshop'));
}
echo $output->render($assessment);
} elseif ($canmanage) {
$options = array('showreviewer' => true, 'showauthor' => false, 'showform' => true);
$assessment = $workshop->prepare_example_assessment($assessment, $mformassessment, $options);
echo $output->render($assessment);