Merge branch 'MDL-30271-switch-role-workshop_21_STABLE' of git://github.com/mudrd8mz/moodle into MOODLE_21_STABLE
This commit is contained in:
@@ -46,6 +46,14 @@ $workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_
|
||||
$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 ($id and $assess and $canassess) {
|
||||
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 @@ if ($edit and $canmanage) {
|
||||
}
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ $string['assessmentenddatetime'] = 'Assessment deadline: {$a->daydatetime} ({$a-
|
||||
$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';
|
||||
|
||||
Reference in New Issue
Block a user