对于某些课程,我在尝试添加作业或使用以下堆栈跟踪打开成绩簿时收到dmlwriteexception:
Debug info: Column 'grademax' cannot be null
INSERT INTO mdl_grade_items (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) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '206',
1 => NULL,
2 => NULL,
3 => 'course',
4 => NULL,
5 => '73',
6 => NULL,
7 => NULL,
8 => NULL,
9 => NULL,
10 => 1,
11 => NULL,
12 => 0,
13 => NULL,
14 => NULL,
15 => 0,
16 => 1,
17 => 0,
18 => 0,
19 => 0,
20 => 1,
21 => 0,
22 => NULL,
23 => 0,
24 => 0,
25 => 1,
26 => 0,
27 => 1474281854,
28 => 1474281854,
29 => 0,
)]
Error code: dmlwriteexception
×Stack trace:
· line 477 of /lib/dml/moodle_database.php: dml_write_exception thrown
· line 1172 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
· line 1218 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
· line 343 of /lib/grade/grade_object.php: call to mysqli_native_moodle_database->insert_record()
· line 472 of /lib/grade/grade_item.php: call to grade_object->insert()
· line 2259 of /lib/grade/grade_category.php: call to grade_item->insert()
· line 2230 of /lib/grade/grade_category.php: call to grade_category->get_grade_item()
· line 2447 of /lib/grade/grade_category.php: call to grade_category->load_grade_item()
· line 897 of /lib/gradelib.php: call to grade_category->is_course_category()
· line 850 of /course/moodleform_mod.php: call to grade_get_categories_menu()
· line 191 of /mod/assign/mod_form.php: call to moodleform_mod->standard_grading_coursemodule_elements()
· line 201 of /lib/formslib.php: call to mod_assign_mod_form->definition()
· line 95 of /course/moodleform_mod.php: call to moodleform->__construct()
· line 255 of /course/modedit.php: call to moodleform_mod->__construct()
×Output buffer: <br /> <b>Notice</b>: Undefined property: stdClass::$requiremodintro in <b>/var/www/html/moodle/course/moodleform_mod.php</b> on line <b>894</b><br /> <br /> <b>Notice</b>: Undefined property: stdClass::$gradepointdefault in <b>/var/www/html/moodle/course/moodleform_mod.php</b> on line <b>814</b><br /> <br /> <b>Notice</b>: Undefined property: stdClass::$gradepointdefault in <b>/var/www/html/moodle/lib/grade/grade_item.php</b> on line <b>270</b><br /> <br /> <b>Notice</b>: Undefined property: stdClass::$gradepointdefault in <b>/var/www/html/moodle/lib/grade/grade_item.php</b> on line <b>270</b><br />
在所有课程中都没有,我在CentOS上使用Moodle 3.1。
请问,我该如何纠正?
答案 0 :(得分:0)
您正尝试在数组中插入null(索引11:grademax)。该计划不喜欢这个。很可能这不是可以为空的字段,可能用于某种类型的计算(平均值?)。我不确定该领域的内容,似乎是班级中的最高等级或最高分数。该字段需要一个值。好像它应该是数字。
答案 1 :(得分:0)
问题似乎是进入非可空字段(grademax)的空条目。稍后在堆栈转储中,它提到$ requiremodintro和$ gradepointdefault作为未定义的属性,这可能是由于在插入之前未加载的配置文件。