$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); $assessment->title = get_string('assessmentbyyourself', 'teamwork'); echo $output->render($assessment);
$event = \mod_teamwork\event\submission_updated::create($params); $event->add_record_snapshot('teamwork', $teamworkrecord); $event->trigger(); // send submitted content for plagiarism detection $fs = get_file_storage(); $files = $fs->get_area_files($teamwork->context->id, 'mod_teamwork', 'submission_attachment', $submission->id); $params['other']['content'] = $formdata->content; $params['other']['pathnamehashes'] = array_keys($files); $event = \mod_teamwork\event\assessable_uploaded::create($params); $event->set_legacy_logdata($logdata); $event->trigger(); $rtn_url = new moodle_url("project.php", array('w' => $formdata->teamworkid, 'instance' => $formdata->instance)); redirect($rtn_url); } } else { echo $output->render($teamwork->prepare_submission($submission, true)); } $PAGE->set_title($teamwork->name); $PAGE->set_heading($course->fullname); if ($edit) { $PAGE->navbar->add(get_string('mysubmission', 'teamwork'), $teamwork->submission_url(), navigation_node::TYPE_CUSTOM); $PAGE->navbar->add(get_string('editingsubmission', 'teamwork')); } elseif ($ownsubmission) { $PAGE->navbar->add(get_string('mysubmission', 'teamwork')); } else { $PAGE->navbar->add(get_string('submission', 'teamwork')); } // show instructions for submitting as thay may contain some list of questions and we need to know them // while reading the submitted answer if (trim($teamwork->instructauthors)) { $instructions = file_rewrite_pluginfile_urls($teamwork->instructauthors, 'pluginfile.php', $PAGE->context->id, 'mod_teamwork', 'instructauthors', 0, teamwork::instruction_editors_options($PAGE->context));