Пример #1
0
// 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);
    $assessment->title = get_string('assessmentbyyourself', 'teamwork');
    echo $output->render($assessment);
} else {
    $options = array('showreviewer' => has_capability('mod/teamwork:viewreviewernames', $teamwork->context), 'showauthor' => has_capability('mod/teamwork:viewauthornames', $teamwork->context), 'showform' => $assessmenteditable or !is_null($assessment->grade), 'showweight' => true);
    $assessment = $teamwork->prepare_assessment($assessment, $mform, $options);
    echo $output->render($assessment);
}
if (!$assessmenteditable and $canoverridegrades) {
    $feedbackform->display();
}
echo $output->footer();