Exemple #1
0
            $record->gradinggradeover = $teamwork->raw_grade_value($data->gradinggradeover, $teamwork->gradinggrade);
            $record->gradinggradeoverby = $USER->id;
            $record->feedbackreviewer = $data->feedbackreviewer;
            $record->feedbackreviewerformat = $data->feedbackreviewerformat;
        }
        $DB->update_record('teamwork_assessments', $record);
        redirect($teamwork->view_url());
    }
}
// output starts here
$output = $PAGE->get_renderer('mod_teamwork');
// teamwork renderer
echo $output->header();
echo $output->heading(format_string($teamwork->name));
echo $output->heading(get_string('assessedsubmission', 'teamwork'), 3);
$submission = $teamwork->get_submission_by_id($submission->id);
// reload so can be passed to the renderer
echo $output->render($teamwork->prepare_submission($submission, has_capability('mod/teamwork:viewauthornames', $teamwork->context)));
// show instructions for assessing as they 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 ($isreviewer) {
    $options = array('showreviewer' => true, 'showauthor' => has_capability('mod/teamwork:viewauthornames', $teamwork->context), 'showform' => $assessmenteditable or !is_null($assessment->grade), 'showweight' => true);
    $assessment = $teamwork->prepare_assessment($assessment, $mform, $options);