Beispiel #1
0
        }
    }
}
// load the form to override gradinggrade and/or set weight and process the submitted data eventually
if ($canoverridegrades or $cansetassessmentweight) {
    $options = array('editable' => true, 'editableweight' => $cansetassessmentweight, 'overridablegradinggrade' => $canoverridegrades);
    $feedbackform = $teamwork->get_feedbackreviewer_form($PAGE->url, $assessment, $options);
    if ($data = $feedbackform->get_data()) {
        $data = file_postupdate_standard_editor($data, 'feedbackreviewer', array(), $teamwork->context);
        $record = new stdclass();
        $record->id = $assessment->id;
        if ($cansetassessmentweight) {
            $record->weight = $data->weight;
        }
        if ($canoverridegrades) {
            $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);