Permalink
Browse files

MDL-18095 gradebook: Make sure grade override flag is cleared wheneve…

…r required

The check for feedback and grade equality between recorded values and the current
form ones before removing override flag is not really required.
  • Loading branch information...
1 parent 6791b08 commit 613b57021d1ee2a83460dcb853b0f5b2c23761ab Ruslan Kabalin committed Mar 8, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 grade/edit/tree/grade.php
View
@@ -193,20 +193,18 @@
$data->feedbackformat = $old_grade_grade->feedbackformat;
}
// update final grade or feedback
+ // when we set override grade the first time, it happens here
$grade_item->update_final_grade($data->userid, $data->finalgrade, 'editgrade', $data->feedback, $data->feedbackformat);
$grade_grade = new grade_grade(array('userid'=>$data->userid, 'itemid'=>$grade_item->id), true);
$grade_grade->grade_item =& $grade_item; // no db fetching
if (has_capability('moodle/grade:manage', $context) or has_capability('moodle/grade:edit', $context)) {
- if (!grade_floats_different($data->finalgrade, $old_grade_grade->finalgrade)
- and $data->feedback === $old_grade_grade->feedback) {
- // change overridden flag only if grade or feedback not changed
- if (!isset($data->overridden)) {
- $data->overridden = 0; // checkbox
- }
- $grade_grade->set_overridden($data->overridden);
+ // change overridden flag
+ if (!isset($data->overridden)) {
+ $data->overridden = 0; // checkbox unticked
}
+ $grade_grade->set_overridden($data->overridden);
}
if (has_capability('moodle/grade:manage', $context) or has_capability('moodle/grade:hide', $context)) {

0 comments on commit 613b570

Please sign in to comment.