Skip to content

Commit

Permalink
MDL-50586 gradingform_rubric: 0-level warning during redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Aug 17, 2016
1 parent b4bb1e6 commit a87b2d7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions grade/grading/form/rubric/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,19 @@
if ($mform->is_cancelled()) {
redirect($returnurl);
} 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
$controller->update_definition($mform->get_data());
redirect($returnurl);
// Everything ok, validated, re-grading confirmed if needed. Make changes to the rubric.
$data = $mform->get_data();
$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();
Expand Down

0 comments on commit a87b2d7

Please sign in to comment.