I think that is true but my inquiry is how do we test its effectiveness? not how we should deploy it.
If we install it on test/staging server, then what? How do we check what was there before the patch and check was is now there after the patch is installed? And do we need to do anything between the 2 states?
- Log in as a teacher in a course.
- Create a course
- Turn editing on.
- Create a quiz
- Edit the quiz and add a new True/false question under the course's default question category.
- Add a "random question" to the quiz using the course's default question category
- Go back to the course page
- Duplicate the quiz
- Duplicate the quiz again
- Duplicate the quiz yet again
- Check the question table on the database. (It's most likely mdl_question). You should see 9 questions on the table.
- Open a terminal, go to your Moodle instance's root directory and run
php admin/tool/task/cli/schedule_task.php --execute=\\qtype_random\\task\\remove_unused_questions
- Confirm that you see a message that 4 unused random questions have been cleaned up.
- Check the question table.
- Confirm that only 5 questions now remain.
Thanks Ken for the detailed info