mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-12517 null not treated properly, max instead of min typo and pretty please initialize all objects properly; merged from MOODLE_19_STABLE
This commit is contained in:
parent
6477f991e6
commit
379ea94931
@ -199,15 +199,18 @@ class grade_report_grader extends grade_report {
|
||||
$finalgrade = unformat_float($postedvalue);
|
||||
}
|
||||
|
||||
// Warn if the grade is out of bounds.
|
||||
$errorstr = '';
|
||||
if ($finalgrade < $grade_item->grademax) {
|
||||
// Warn if the grade is out of bounds.
|
||||
if (is_null($finalgrade)) {
|
||||
// ok
|
||||
} else if ($finalgrade < $grade_item->grademin) {
|
||||
$errorstr = 'lessthanmin';
|
||||
} else if ($finalgrade > $grade_item->grademax) {
|
||||
$errorstr = 'morethanmax';
|
||||
}
|
||||
if ($errorstr) {
|
||||
$user = get_record('user', 'id', $userid,'','','','','id, firstname, lastname');
|
||||
$gradestr = new object();
|
||||
$gradestr->username = fullname($user);
|
||||
$gradestr->itemname = $grade_item->get_name();
|
||||
notify(get_string($errorstr, 'grades', $gradestr));
|
||||
|
Loading…
x
Reference in New Issue
Block a user