mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-64161 gradereport_singleview: Stop updating grades with errors.
This commit is contained in:
parent
599703e83d
commit
f2462522f6
@ -355,6 +355,10 @@ abstract class screen {
|
||||
// Optional type.
|
||||
if (!empty($msg)) {
|
||||
$warnings[] = $msg;
|
||||
if ($element instanceof \gradereport_singleview\local\ui\finalgrade) {
|
||||
// This item wasn't changed so don't add to the changecount.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (preg_match('/_(\d+)_(\d+)/', $varname, $matchelement)) {
|
||||
$changecount[$matchelement[0]] = 1;
|
||||
|
@ -170,9 +170,11 @@ class finalgrade extends grade_attribute_format implements unique_value, be_disa
|
||||
}
|
||||
$gradestr->itemname = $this->grade->grade_item->get_name();
|
||||
$errorstr = get_string($errorstr, 'grades', $gradestr);
|
||||
return $errorstr;
|
||||
}
|
||||
|
||||
// Only update grades if there are no errors.
|
||||
$gradeitem->update_final_grade($userid, $finalgrade, 'singleview', $feedback, FORMAT_MOODLE);
|
||||
return $errorstr;
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user