MDL-81890 assign: confirm_sesskey fixed in view_fix_rescaled_null_grades

This commit is contained in:
meirzamoodle
2024-06-06 22:21:42 +08:00
committed by Jun Pataleta
parent 093aedf798
commit dc84fcfab0
+14 -12
View File
@@ -9504,20 +9504,22 @@ class assign {
$confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($confirm) {
confirm_sesskey();
// Fix the grades.
$this->fix_null_grades();
unset_config('has_rescaled_null_grades_' . $instance->id, 'assign');
// Display the notice.
$o .= $this->get_renderer()->notification(get_string('fixrescalednullgradesdone', 'assign'), 'notifysuccess');
if (confirm_sesskey()) {
// Fix the grades.
$this->fix_null_grades();
unset_config('has_rescaled_null_grades_' . $instance->id, 'assign');
// Display the success notice.
$o .= $this->get_renderer()->notification(get_string('fixrescalednullgradesdone', 'assign'), 'notifysuccess');
} else {
// If the sesskey is not valid, then display the error notice.
$o .= $this->get_renderer()->notification(get_string('invalidsesskey', 'error'), 'notifyerror');
}
$url = new moodle_url(
'/mod/assign/view.php',
array(
url: '/mod/assign/view.php',
params: [
'id' => $this->get_course_module()->id,
'action' => 'grading'
)
'action' => 'grading',
],
);
$o .= $this->get_renderer()->continue_button($url);
} else {