Esempio n. 1
0
$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) {
    $options = array('showreviewer' => true, 'showauthor' => false, 'showform' => true);
    $assessment = $teamwork->prepare_example_assessment($assessment, $mformassessment, $options);
    echo $output->render($assessment);
}
echo $output->footer();