mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-50586 gradingform_rubric: 0-level warning during redirection
This commit is contained in:
parent
b4bb1e65dc
commit
a87b2d70ec
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user