mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-56646 assign: Fix negative grades in restore
This commit is contained in:
parent
7323c473cc
commit
465b75ed1f
@ -240,7 +240,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 != ASSIGN_GRADE_NOT_SET) {
|
||||
$data->grade = ASSIGN_GRADE_NOT_SET;
|
||||
}
|
||||
$newitemid = $DB->insert_record('assign_grades', $data);
|
||||
|
||||
// Note - the old contextid is required in order to be able to restore files stored in
|
||||
|
@ -8612,7 +8612,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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user