Invalid MC Questions

Moodle allows a multiple choice question to be saved with invalid information.  This can cause errors when students try to take a quiz with the question or when teachers try to edit the question.


  • mdl_question_multichoice
  • mdl_question
  • Get list of multiple choice questions: select id,category,name,questiontext,qtype from mdl_question where qtype='multichoice';

What has happened is that MC questions were created without any possible responses.

Option 1: Delete the question using the Moodle Interface

  • used this 7/9/2012

Option 2: inject answer into MC table so it can be edited.

INSERT INTO mdl_question_multichoice (question,layout,answers,single,suffleanswers,answernumbering,shownumcorrect) values ( QUESTIONID, 0, XX [use existing answer option?], 1, 1, 'abc', 0 )