error/error_question_answers_missing_in_db

Re: error/error_question_answers_missing_in_db

by Giancarlo De Pol -
Number of replies: 2

Hi,same issue here, 2.6.1. I can see the culprit questions by turning on Debug->Developer, they show up during Restore; the process hangs and the log shows e.g.

Error code: error_question_answers_missing_in_db
$a contents: stdClass Object
(
[filequestionid] => 18278
[dbquestionid] => 69659
[answer] => 10 N
)

they all have leading or trailing spaces, as Sam Alexander says, here there's an extra space in front of "10 N". I don't think I can use your solution from within MOODLE as administrator, so I'm chasing them one by one, which is lengthy. Is there a way I can find the question, knowing the "filequestionid" provided by the log? I mean, find where the question is in the categories, so I can edit it and drop the extra spaces?

Thanks, Giancarlo

In reply to Giancarlo De Pol

Re: error/error_question_answers_missing_in_db

by Sam Alexander -

Giancarlo,

The only way I figured to do that was through MySQL. See if you can find someone that knows MySQL and can run the command I gave earlier. I ran it from the web based administration tool phpMyAdmin.  I hope this helps.

Sam Alexander

In reply to Giancarlo De Pol

Re: error/error_question_answers_missing_in_db

by Josef Kovar -

Hello,
teachers have a problem with copying tests. When you try to create a copy of the test using the "Duplicate" error appears : error_question_answers_missing_in_db (see printscren).
error/error_question_answers_missing_in_db
Debug info: Error code: error_question_answers_missing_in_db $a contents: stdClass Object ( [filequestionid] => 23002 [dbquestionid] => 23016 [answer] => Norsko )
* line 185 of /backup/moodle2/restore_qtype_plugin.class.php: restore_step_exception thrown
* line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_plugin->process_question_answer()
* line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
* line 151 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
* line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
* line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
* line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
* line 190 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
* line 278 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
* line ? of unknownfile: call to progressive_parser->end_tag()
* line 179 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
* line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
* line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
* line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
* line 177 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
* line 167 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
* line 333 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
* line 3507 of /course/lib.php: call to restore_controller->execute_plan()
* line 3434 of /course/lib.php: call to duplicate_module()
* line 118 of /course/rest.php: call to mod_duplicate_activity()
What should I do? Is there any solution ? Please help.

Best regards,
Josef Kovar
Metropolitan university Prague

Attachment error_question_answers_missing_in_db.JPG