如何解决Moodle计算题错误



我目前正在尝试更新一些计算结果,但当我更新时,我会收到以下错误消息:


More information about this error
Debug info:
Error code: ddlfieldnotexist
Stack trace:
line 672 of /lib/dml/moodle_database.php: dml_exception thrown
line 1919 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
line 1762 of /question/type/calculated/questiontype.php: call to moodle_database->count_records()
line 133 of /question/type/calculated/datasetitems_form.php: call to qtype_calculated->print_dataset_definitions_category_shared()
line 214 of /lib/formslib.php: call to question_dataset_dependent_items_form->definition()
line 114 of /question/type/calculated/datasetitems_form.php: call to moodleform->__construct()
line 412 of /question/type/calculated/questiontype.php: call to question_dataset_dependent_items_form->__construct()
line 201 of /question/bank/editquestion/question.php: call to qtype_calculated->next_wizard_form()

我认为这可能与问题中的通配符有关。

如有任何帮助,我们将不胜感激。谢谢你抽出时间。

看起来这是一个错误,特别是在使用通配符时

这是的代码行

$nbofquiz = $DB->count_records('quiz_slots', array('questionid' => $qu->id));

https://github.com/moodle/moodle/blob/v4.0.2/question/type/calculated/questiontype.php#L1762

该错误是由Moodle 4的升级引起的,该升级删除了Moodle票证MDL-71696 的quiz_slots表中的questionid字段

MDL-71696 mod_quiz:测验更新和行为覆盖

$field = new xmldb_field('questionid');
// Conditionally launch drop field questionid.
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}

https://github.com/moodle/moodle/blob/v4.0.2/mod/quiz/db/upgrade.php#L150

我在Moodle bug追踪器上进行了快速搜索,并在6月份被报道。

https://tracker.moodle.org/browse/MDL-75041

集成中有一个修复程序,看起来他们昨天已经完成了测试,所以应该很快就会提供

https://tracker.moodle.org/browse/MDL-74941

最新更新