0

I am currently trying to update some of the calculated but when I do I get these error messages:


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()

I think it might have something to do with the wildcard in the question.

Any help would be appreciated greatly. Thank you for your time.

1 Answers1

0

Looks like this is a bug, specifically when using wildcards

This is the line of code

$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

The bug was caused by the upgrade to Moodle 4 which removed the questionid field in table quiz_slots for Moodle ticket MDL-71696

MDL-71696 mod_quiz: quiz updates and behat coverage

$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

I had a quick search on the Moodle bug tracker and it was reported back in June.

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

There is a fix in integration, looks like they finished testing yesterday, so should be available soon

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

Russell England
  • 9,436
  • 1
  • 27
  • 41