We ran into problems with huge amount of garbage random quizes, probably from the copy bug (https://tracker.moodle.org/browse/MDL-63260), we are using Moodle 3.6.6.
This is before we started the cleaning cron job: \qtype_random\task\remove_unused_questions
SELECT count(q.id) FROM mdl_question q WHERE q.qtype = 'random' and q.id NOT IN (SELECT b.questionid FROM mdl_quiz_slots b);
Result '992541'
The cron job did its work and deleted all unused random questions.
But I then searched for unused questions of another type then random
SELECT count(q.id) FROM mdl_question q WHERE q.qtype != 'random' and q.id NOT IN (SELECT b.questionid FROM mdl_quiz_slots b);
Result '561958'
Should I consider these as garbage too and what is the best way to clean this up?