Having spent many hours editing and revising the complete question bank for a moodle course I teach, I am trying to clean up the old categories. I created new categories for the edited questions. When I try to delete the old categories I keep getting a message like this "The category 'ontains 12 questions (some of them may be old, hidden, questions that are still in use in some existing quizzes). Please choose another category to move them to." I have removed EVERY quiz in the course to try to get aroung this - but that did not work. How do I get rid of these old categories?
If you turn on the 'also show old questions' option in the question bank, the you should be able to see those questions. If you have deleted all the quizzes that use them, you should now be able to really delete them.
I tried this just now - it still will not let me delete the category. I checked the "old questions" option and deleted every question that showed up. It is a new course and there are no quizzes anywhere in it. But I still get the "category contains ...." sign when I try to delete it.
perhaps there is a bug here. Sorry about that. It would be very helpful if someone could come up with some simple steps to reproduce. Something along the lines of
- Create new course
- Create new question category
- Create question in cateogry
- Create quiz
- Add question to quiz
- Delete quiz
- Delete question
- Try to delete category, and fail.
That is just to show the general style. Hopefully somethat that simple will work properly.
The only solution I have found is to create a "Trash" category. So when i get the command "Please choose another category to move them to" , that is where i move the hidden questions. Then I can delete the original category. But I can not delete the "trash" even though it shows no questions (even when the "show hidden questions" option is checked). Thanks for the input.
Ah! I have just remembered the other type of hidden questions. Acutally there are two types of these: random questions, and bits of Cloze questions that should have been deleted, but which are still left for some reason.
To work out what is going on, you would need to do this:
1. Get the id of the category you are trying to delete. Let us suppose it is 123. (You can get this from the URL of some pages, like the 'are you sure you want to delete this category' page.)
2. Using a tool like phpMyAdmin to look direclty in the database, run a query like
SELECT * FROM mdl_questions WHERE category = 123
and see what you get.