Add a question from question bank

Re: Add a question from question bank

by Henrique F Machado -
Number of replies: 1

Thanks for everyone that helped. We also faced this issue at work and this discussion helped a lot.

One thing that I found out is that the question's corruption in the database prevents us from editing and deleting it, but not from moving it. So, while we prepare the backups and all we need to go directly to the database, we created a "Garbage questions (don't use)" category below "System" and moved the problematic questions there. Now there's no more corrupted question inside the course's question bank so inserting questions from the bank to a quiz is working. I don't know if there's any adverse side effects to this, though.

Using Moodle 3.5.1 (Build: 20180709)

Average of ratings: Useful (2)
In reply to Henrique F Machado

Re: Add a question from question bank

by arif wicahyanto -

It's happen when I import moodle  multiple question XML format , but the XML didn't include the answer (my mistake when creating XML format). The question imported with no answer option. The question can not deleted. So I did delete with SQL.

delete from mdl_question where id IN

(

SELECT

aa.id

FROM

(select DISTINCT id from mdl_question) AS aa

LEFT JOIN mdl_qtype_multichoice_options bb ON aa.id = bb.questionid

WHERE

bb.questionid IS NULL

)