$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();
// open for editing? $delete = optional_param('delete', false, PARAM_BOOL); // example removal requested $confirm = optional_param('confirm', false, PARAM_BOOL); // example removal request confirmed $assess = optional_param('assess', false, PARAM_BOOL); // assessment required $cm = get_coursemodule_from_id('teamwork', $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'); } $teamwork = $DB->get_record('teamwork', array('id' => $cm->instance), '*', MUST_EXIST); $teamwork = new teamwork($teamwork, $cm, $course); $PAGE->set_url($teamwork->exsubmission_url($id), array('edit' => $edit)); $PAGE->set_title($teamwork->name); $PAGE->set_heading($course->fullname); if ($edit) { $PAGE->navbar->add(get_string('exampleediting', 'teamwork')); } else { $PAGE->navbar->add(get_string('example', 'teamwork')); } $output = $PAGE->get_renderer('mod_teamwork'); if ($id) { // example is specified $example = $teamwork->get_example_by_id($id); } else { // no example specified - create new one require_capability('mod/teamwork:manageexamples', $teamwork->context); $example = new stdclass();