mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-47059 Grades: Update the grade_grade if the finalgrade/or the grademax has changed.
Part of: MDL-46576
This commit is contained in:
parent
1577229f93
commit
90cc8ce7c4
@ -677,10 +677,12 @@ class grade_category extends grade_object {
|
||||
$finalgrade = grade_grade::standardise_score($agg_grade, 0, 1, $result['grademin'], $result['grademax']);
|
||||
|
||||
$grade->finalgrade = $this->grade_item->bounded_grade($finalgrade);
|
||||
$oldrawgrademax = $grade->rawgrademax;
|
||||
$grade->rawgrademax = $result['grademax'];
|
||||
|
||||
// update in db if changed
|
||||
if (grade_floats_different($grade->finalgrade, $oldfinalgrade)) {
|
||||
if (grade_floats_different($grade->finalgrade, $oldfinalgrade) ||
|
||||
grade_floats_different($grade->rawgrademax, $oldrawgrademax)) {
|
||||
$grade->update('aggregation');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user