One case is random question, which use parent == question.id as a convention.
The other case is multianswer questions, where the subquestions have a parent pointing at the parent question.
Hello,
I use Moodle 2.3.6
Could you give more information about "One case is random question, which use parent == question.id as a convention" ?
I explain my problem : I want to delete a category of questions but Moodle tells me "there are 10 questions in this category".
When I display the category, no question appears. If I check in the database, I find them with the field 'parent = question.id' and the name like "Random (Default for *coursename*).
Example :
id | category | parent | name |
---|---|---|---|
9054 | 2426 | 9054 |
Random (Default for Test) |
When I look the page /report/questioninstances, there are 10 visibles questions in the course.
What are these questions ? How can I delete them ?
(I found 70 questions like that, mainly (could be even 'only') in courses created by duplicating another course.)
Thanks !
Pascal
Right, those are random questions. The most reliable way to detect that is to look in the qtype column.
If there are no references to that question in the quiz_question_instances table, then you can safely delete it.
Yes, we should make Moodle smarter about dealing with this automatically.
Yes, that would be useful!
Perhaps by adding some checks in /admin/tool/health/ and solutions (queries to apply in DB) if needed.