Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-30271-switch-role-workshop_21_STABLE' of git://gith…

…ub.com/mudrd8mz/moodle into MOODLE_21_STABLE
  • Loading branch information...
commit 494b6c9e395bda6d3b07393c6c30c8bb525ff3ee 2 parents 96b7a40 + 1b73e20
@samhemelryk samhemelryk authored
Showing with 18 additions and 9 deletions.
  1. +17 −9 mod/workshop/exsubmission.php
  2. +1 −0  mod/workshop/lang/en/workshop.php
View
26 mod/workshop/exsubmission.php
@@ -46,6 +46,14 @@
$workshop = new workshop($workshop, $cm, $course);
$PAGE->set_url($workshop->exsubmission_url($id), array('edit' => $edit));
+$PAGE->set_title($workshop->name);
+$PAGE->set_heading($course->fullname);
+if ($edit) {
+ $PAGE->navbar->add(get_string('exampleediting', 'workshop'));
+} else {
+ $PAGE->navbar->add(get_string('example', 'workshop'));
+}
+$output = $PAGE->get_renderer('mod_workshop');
if ($id) { // example is specified
$example = $workshop->get_example_by_id($id);
@@ -95,6 +103,15 @@
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));
}
@@ -167,16 +184,7 @@
}
}
-$PAGE->set_title($workshop->name);
-$PAGE->set_heading($course->fullname);
-if ($edit) {
- $PAGE->navbar->add(get_string('exampleediting', 'workshop'));
-} else {
- $PAGE->navbar->add(get_string('example', 'workshop'));
-}
-
// Output starts here
-$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $output->heading(format_string($workshop->name), 2);
View
1  mod/workshop/lang/en/workshop.php
@@ -53,6 +53,7 @@
$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';
Please sign in to comment.
Something went wrong with that request. Please try again.