if (!$asid) {
$asid = $workshop->add_allocation($example, $USER->id, 0);
}
+ if ($asid == workshop::ALLOCATION_EXISTS) {
+ // the training assessment of the example was not found but the allocation already
+ // exists. this probably means that the user is the author of the reference assessment.
+ echo $output->header();
+ echo $output->box(get_string('assessmentreferenceconflict', 'workshop'));
+ echo $output->continue_button($workshop->view_url());
+ echo $output->footer();
+ die();
+ }
redirect($workshop->exassess_url($asid));
}
$string['assessmentform'] = 'Assessment form';
$string['assessmentofsubmission'] = '<a href="{$a->assessmenturl}">Assessment</a> of <a href="{$a->submissionurl}">{$a->submissiontitle}</a>';
$string['assessmentreference'] = 'Reference assessment';
+$string['assessmentreferenceconflict'] = 'It is not possible to assess an example submission for which you provided a reference assessment.';
$string['assessmentreferenceneeded'] = 'You have to assess this example submission to provide a reference assessment. Click \'Continue\' button to assess the submission.';
$string['assessmentsettings'] = 'Assessment settings';
$string['assessmentstart'] = 'Open for assessment from';