Managing categories in the question bank (Moodle 2.1)

Managing categories in the question bank (Moodle 2.1)

by Debra Bretz -
Number of replies: 5

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?

Average of ratings: -
In reply to Debra Bretz

Re: Managing categories in the question bank (Moodle 2.1)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

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.

In reply to Tim Hunt

Re: Managing categories in the question bank (Moodle 2.1)

by Debra Bretz -

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.

In reply to Debra Bretz

Re: Managing categories in the question bank (Moodle 2.1)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

sad 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

  1. Create new course
  2. Create new question category
  3. Create question in cateogry
  4. Create quiz
  5. Add question to quiz
  6. Delete quiz
  7. Delete question
  8. Try to delete category, and fail.

That is just to show the general style. Hopefully somethat that simple will work properly.

In reply to Tim Hunt

Re: Managing categories in the question bank (Moodle 2.1)

by Debra Bretz -

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.

In reply to Debra Bretz

Re: Managing categories in the question bank (Moodle 2.1)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

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.