Posted on Leave a comment

Can not find data record in database table qtype_multichoice_options Moodle

This is because of buggy questions imported by file import.

1- Run below query and then save the result in text file

SELECT t1.id, t1.name
FROM mdl_question t1
LEFT JOIN mdl_qtype_multichoice_options t2 ON t1.id = t2.questionid
WHERE t1.qtype=’multichoice’ AND t2.id IS NULL

2- Then run another query to delete buggy questions by ID

Delete from mdl_question where id in (id1, id2, ….)

Leave a Reply