Note: You are currently viewing documentation for Moodle 3.7. Up-to-date documentation for the latest stable version of Moodle may be available here: error/moodle/error question answers missing in db.

error/moodle/error question answers missing in db: Difference between revisions

From MoodleDocs
(extra info)
No edit summary
Line 1: Line 1:
This could mean that you have a question in your quiz or dataset that is not restoring properly. According to MDL-34812, question text which has been pasted from MS Word might be a cause of this.
This error occurs occasionally when you are restoring a quizzes or question bank that has shared questions. The restore process will look to see if the shared questions already exist in database where the backup is being restored. If they do, it will link to the existing questions in the database, instead of creating new copied of the shared questions. This error occurs when that process fails.
 
In order to restore the shared questions, all the different parts of the question like question_answer rows (e.g. the choices of a multiple choice question) have to be matched up. This error occurs when the restore process looks in the database for a particular row that matches something in the backup file, and fails to find it.
 
In the past, more specific causes of this have been tracked down to:
* Unusual combinations of whitespace in the question_answers. (When these are written out to to the XML in the backup file, then read back in, this can change the whitespace so that it no longer matches exactly. However, once we identified that, we changed to code so that this should no longer be a problem.)
* More generally, in MDL-34812, this was linked to questions where text had been pasted from MS Word.


== Possible solutions ==
== Possible solutions ==


# Restore the questions manually into your course and recreate the quiz.
# Restore the questions manually into your course (or perhaps move them using Export and Import in the question bank) and recreate the quiz.


# Try copying system level questions into the course.  Use the '''edit''' button and then click the '''Make copy''' button at the bottom of the page. Then try moving it. If that triggers an error, then you know which question is causing the problem.  
# Try to work out which particular question is causing the problem. Move the question you suspect into a course on its own in the question bank, then try duplicating that to see if it still triggers the error.


== Other notes ==
== Other notes ==
The file that is throwing this error is /backup/moodle2/restore_qtype_plugin.class.php  around line 159.
The file that is throwing this error is /backup/moodle2/restore_qtype_plugin.class.php  around line 159.


[[es:error/moodle/error question answers missing in db]]
[[es:error/moodle/error question answers missing in db]]

Revision as of 06:10, 31 May 2016

This error occurs occasionally when you are restoring a quizzes or question bank that has shared questions. The restore process will look to see if the shared questions already exist in database where the backup is being restored. If they do, it will link to the existing questions in the database, instead of creating new copied of the shared questions. This error occurs when that process fails.

In order to restore the shared questions, all the different parts of the question like question_answer rows (e.g. the choices of a multiple choice question) have to be matched up. This error occurs when the restore process looks in the database for a particular row that matches something in the backup file, and fails to find it.

In the past, more specific causes of this have been tracked down to:

  • Unusual combinations of whitespace in the question_answers. (When these are written out to to the XML in the backup file, then read back in, this can change the whitespace so that it no longer matches exactly. However, once we identified that, we changed to code so that this should no longer be a problem.)
  • More generally, in MDL-34812, this was linked to questions where text had been pasted from MS Word.

Possible solutions

  1. Restore the questions manually into your course (or perhaps move them using Export and Import in the question bank) and recreate the quiz.
  1. Try to work out which particular question is causing the problem. Move the question you suspect into a course on its own in the question bank, then try duplicating that to see if it still triggers the error.

Other notes

The file that is throwing this error is /backup/moodle2/restore_qtype_plugin.class.php around line 159.