MDL-56646 assign: Fix negative grades in restore
This commit is contained in:
@@ -243,7 +243,10 @@ class restore_assign_activity_structure_step extends restore_activity_structure_
|
||||
$flags->userid = $this->get_mappingid('user', $data->userid);
|
||||
$DB->insert_record('assign_user_flags', $flags);
|
||||
}
|
||||
|
||||
// Fix null grades that were rescaled.
|
||||
if ($data->grade < 0 && $data->grade != -1) {
|
||||
$data->grade = -1;
|
||||
}
|
||||
$newitemid = $DB->insert_record('assign_grades', $data);
|
||||
|
||||
// Note - the old contextid is required in order to be able to restore files stored in
|
||||
|
||||
@@ -8607,7 +8607,7 @@ class assign {
|
||||
|
||||
// Fix the grades.
|
||||
$this->fix_null_grades();
|
||||
set_config('has_rescaled_null_grades_' . $instance->id, 0, 'assign');
|
||||
unset_config('has_rescaled_null_grades_' . $instance->id, 'assign');
|
||||
|
||||
// Display the notice.
|
||||
$o .= $this->get_renderer()->notification(get_string('fixrescalednullgradesdone', 'assign'), 'notifysuccess');
|
||||
|
||||
Reference in New Issue
Block a user