MDL-50586 gradingform_rubric: 0-level warning during redirection

This commit is contained in:
Marina Glancy 2016-08-17 12:49:10 +08:00
parent b4bb1e65dc
commit a87b2d70ec

View File

@ -50,9 +50,19 @@ $mform->set_data($data);
if ($mform->is_cancelled()) { if ($mform->is_cancelled()) {
redirect($returnurl); redirect($returnurl);
} else if ($mform->is_submitted() && $mform->is_validated() && !$mform->need_confirm_regrading($controller)) { } else if ($mform->is_submitted() && $mform->is_validated() && !$mform->need_confirm_regrading($controller)) {
// everything ok, validated, re-grading confirmed if needed. Make changes to the rubric // Everything ok, validated, re-grading confirmed if needed. Make changes to the rubric.
$controller->update_definition($mform->get_data()); $data = $mform->get_data();
redirect($returnurl); $controller->update_definition($data);
// If we do not go back to management url and the minscore warning needs to be displayed, display it during redirection.
$warning = null;
if (!empty($data->returnurl)) {
if (($scores = $controller->get_min_max_score()) && $scores['minscore'] <> 0) {
$warning = get_string('zerolevelsabsent', 'gradingform_rubric').'<br>'.
html_writer::link($manager->get_management_url(), get_string('back'));
}
}
redirect($returnurl, $warning, null, \core\output\notification::NOTIFY_ERROR);
} }
echo $OUTPUT->header(); echo $OUTPUT->header();