Beispiel #1
0
} else {
    print_error('nopermissions', 'error', $teamwork->view_url(), 'compare example assessment');
}
$PAGE->set_title($teamwork->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('examplecomparing', 'teamwork'));
// Output starts here
$output = $PAGE->get_renderer('mod_teamwork');
echo $output->header();
echo $output->heading(format_string($teamwork->name));
echo $output->heading(get_string('assessedexample', 'teamwork'), 3);
echo $output->render($teamwork->prepare_example_submission($example));
// if the reference assessment is available, display it
if (!empty($mformreference)) {
    $options = array('showreviewer' => false, 'showauthor' => false, 'showform' => true);
    $reference = $teamwork->prepare_example_reference_assessment($reference, $mformreference, $options);
    $reference->title = get_string('assessmentreference', 'teamwork');
    if ($canmanage) {
        $reference->url = $teamwork->exassess_url($reference->id);
    }
    echo $output->render($reference);
}
if ($isreviewer) {
    $options = array('showreviewer' => true, 'showauthor' => false, 'showform' => true);
    $assessment = $teamwork->prepare_example_assessment($assessment, $mformassessment, $options);
    $assessment->title = get_string('assessmentbyyourself', 'teamwork');
    if ($teamwork->assessing_examples_allowed()) {
        $assessment->add_action(new moodle_url($teamwork->exsubmission_url($example->id), array('assess' => 'on', 'sesskey' => sesskey())), get_string('reassess', 'teamwork'));
    }
    echo $output->render($assessment);
} elseif ($canmanage) {
Beispiel #2
0
$example = $teamwork->get_example_by_id($example->id);
// reload so can be passed to the renderer
echo $output->render($teamwork->prepare_example_submission($example));
// show instructions for assessing as thay may contain important information
// for evaluating the assessment
if (trim($teamwork->instructreviewers)) {
    $instructions = file_rewrite_pluginfile_urls($teamwork->instructreviewers, 'pluginfile.php', $PAGE->context->id, 'mod_teamwork', 'instructreviewers', 0, teamwork::instruction_editors_options($PAGE->context));
    print_collapsible_region_start('', 'teamwork-viewlet-instructreviewers', get_string('instructreviewers', 'teamwork'));
    echo $output->box(format_text($instructions, $teamwork->instructreviewersformat, array('overflowdiv' => true)), array('generalbox', 'instructions'));
    print_collapsible_region_end();
}
// extend the current assessment record with user details
$assessment = $teamwork->get_assessment_by_id($assessment->id);
if ($canmanage and $assessment->weight == 1) {
    $options = array('showreviewer' => false, 'showauthor' => false, 'showform' => true);
    $assessment = $teamwork->prepare_example_reference_assessment($assessment, $mform, $options);
    $assessment->title = get_string('assessmentreference', 'teamwork');
    echo $output->render($assessment);
} else {
    if ($isreviewer) {
        $options = array('showreviewer' => true, 'showauthor' => false, 'showform' => true);
        $assessment = $teamwork->prepare_example_assessment($assessment, $mform, $options);
        $assessment->title = get_string('assessmentbyyourself', 'teamwork');
        echo $output->render($assessment);
    } else {
        if ($canmanage) {
            $options = array('showreviewer' => true, 'showauthor' => false, 'showform' => true, 'showweight' => false);
            $assessment = $teamwork->prepare_example_assessment($assessment, $mform, $options);
            echo $output->render($assessment);
        }
    }