Moodle Error

Re: Moodle Error

by Laura DiFiore -
Number of replies: 0
I got hit by this same bug/error earlier today and am now locked out of the gradebook in my course. Hours of searching later, I've determined the error is caused by a bug when unlimited grades are set and the total possible points exceed 10,000. I found an entry for this in the Moodle bug tracker https://tracker.moodle.org/browse/MDL-63544

I am using Moodle 3.9.7+

Did you ever fix the error on your site? If so, can you let me know how you fixed it because right now, I'm completely stumped how to fix this error, at least temporarily, so I can access the gradebook again.

Debug info: Out of range value for column 'grademax' at row 1
UPDATE mdl_grade_items SET courseid = ?,categoryid = ?,itemname = ?,itemtype = ?,itemmodule = ?,iteminstance = ?,itemnumber = ?,iteminfo = ?,idnumber = ?,calculation = ?,gradetype = ?,grademax = ?,grademin = ?,scaleid = ?,outcomeid = ?,gradepass = ?,multfactor = ?,plusfactor = ?,aggregationcoef = ?,aggregationcoef2 = ?,sortorder = ?,display = ?,decimals = ?,locked = ?,locktime = ?,needsupdate = ?,weightoverride = ?,timecreated = ?,timemodified = ?,hidden = ? WHERE id=?
[array (
0 => '6',
1 => NULL,
2 => '',
3 => 'course',
4 => NULL,
5 => '7',
6 => NULL,
7 => '',
8 => '',
9 => NULL,
10 => 1,
11 => 103184.0,
12 => 0.0,
13 => NULL,
14 => NULL,
15 => '10000.00000',
16 => 1.0,
17 => 0.0,
18 => 0.0,
19 => 0.0,
20 => '1',
21 => '0',
22 => NULL,
23 => '0',
24 => '0',
25 => 1,
26 => '0',
27 => '1623395588',
28 => 1625307942,
29 => '0',
30 => '17',
)]
Error code: dmlwriteexception
×Stack trace: * line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown

line 1587 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1619 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
line 253 of /lib/grade/grade_object.php: call to mysqli_native_moodle_database->update_record()
line 312 of /lib/grade/grade_item.php: call to grade_object->update()
line 1565 of /lib/grade/grade_category.php: call to grade_item->update()
line 454 of /lib/grade/grade_category.php: call to grade_category->auto_update_max()
line 1182 of /lib/gradelib.php: call to grade_category->pre_regrade_final_grades()
line 418 of /lib/gradelib.php: call to grade_regrade_final_grades()
line 244 of /grade/edit/tree/index.php: call to grade_regrade_final_grades_if_required()