Moodle 外派及;成绩册错误

Moodle 外派及;成绩册错误,moodle,Moodle,对于某些课程,我在尝试添加作业或打开成绩册时收到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,gra

对于某些课程,我在尝试添加作业或打开成绩册时收到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 />
Debug info:列“grademax”不能为空
插入mdl_grade_项目(courseid、categoryid、itemname、itemtype、itemmodule、iteminstance、itemnumber、iteminfo、idnumber、calculation、gradetype、grademax、grademin、scaleid、outcomeid、gradepass、multfactor、plusfactor、aggregationcoef、aggregationcoef2、Sortor、display、decimals、locked、locktime、needsupdate、weightoverride、timecreated、timemodified、hidden)数值(?、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
[阵列(
0 => '206',
1=>NULL,
2=>NULL,
3=>“课程”,
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,
)]
错误代码:dmlwriteexception
×堆栈跟踪:
·/lib/dml/moodle_database.php的第477行:引发dml_write_异常
·/lib/dml/mysqli_native_moodle_database.php的第1172行:调用moodle_database->query_end()
·/lib/dml/mysqli_native_moodle_database.php的第1218行:调用mysqli_native_moodle_database->insert_record_raw()
·/lib/grade/grade_object.php的第343行:调用mysqli_native_moodle_数据库->插入_记录()
·/lib/grade/grade\u item.php的第472行:调用grade\u对象->插入()
·/lib/grade/grade\u category.php的第2259行:调用grade\u项->插入()
·/lib/grade/grade\u category.php的第2230行:调用grade\u category->get\u grade\u item()
·/lib/grade/grade\u category.php的第2447行:调用grade\u category->load\u grade\u item()
·/lib/gradelib.php的第897行:调用grade\u category->is\u course\u category()
·第850行/course/moodleform_mod.php:调用grade_get_categories_menu()
·/mod/assign/mod_form.php的第191行:调用moodleform_mod->standard_grading_coursemodule_elements()
·/lib/formslib.php的第201行:调用mod\u assign\u mod\u form->definition()
·第95行/course/moodleform_mod.php:调用moodleform->__construct()
·/course/modedit.php的第255行:调用moodleform_mod->__construct()
×输出缓冲区:
注意:未定义的属性:stdClass::第894行/var/www/html/moodle/course/moodleform_mod.php中的$requiremodintro

注意:未定义的属性:stdClass::第814行/var/www/html/moodle/course/moodleform_mod.php中的$gradepointdefault/第270行的var/www/html/moodle/lib/grade/grade_item.php注意:第270行的/var/www/html/moodle/lib/grade/grade_item.php中未定义的属性:stdClass::$gradepointdefault
并非所有课程都会出现这种情况,我正在CentOS上使用Moodle 3.1


请问,我如何更正此问题?

您正试图在数组中插入null(在索引11:grademax处)。程序不喜欢这样。很可能这不是一个可为空的字段,可能用于某种类型的计算(平均值?)。我不确定这一领域的情况,似乎是全班最高的分数或最高的分数。此字段需要一个值。看起来应该是数字的

您正试图将null插入数组(在索引11:grademax处)。程序不喜欢这样。很可能这不是一个可为空的字段,可能用于某种类型的计算(平均值?)。我不确定这一领域的情况,似乎是全班最高的分数或最高的分数。此字段需要一个值。看起来应该是数字的

问题似乎是不可为空的字段(grademax)中的空条目。不过,在堆栈转储的后面部分,它提到$requiremodintro和$gradepointdefault是未定义的属性,这可能是由于插入之前未加载配置文件造成的。

问题似乎是不可为空的字段(grademax)中的空条目。不过,在堆栈转储的后面部分,它提到$requiremodintro和$gradepointdefault是未定义的属性,这可能是由于插入之前未加载配置文件造成的。

我不确定,但只关心最后一行中出现的未定义属性。您确定这不是创建问题吗?这是该文件的第894行:$required=$CFG->requiremodintro;我不确定,但只关心最后一行中出现的未定义属性。您确定这不是创建问题吗?这是该文件的第894行:$required=$CFG->requiremodintro;