Will deleting a quiz delete the questions?

Will deleting a quiz delete the questions?

by Melissa Benson -
Number of replies: 5

Moodle 2.5

The teacher made a quiz, created quiz questions and those quiz questions were in the default category for that specific quiz. The quiz was then deleted. The quiz questions are nowhere to be found. I checked all of the other categories, checked the "show old questions". I can't find the questions anywhere.

I thought that questions would just go into the default category for that course or something and doing research online keeps telling me that quiz and quiz questions are separate.

Sooo....I went into the database (phpmyadmin) and I was able to find the category (even though it was deleted? huh?) and I got the category ID. I then was able to go into the question table and look up the questions by seeing which questions had that ID. Found the questions!!!

note: I took the URL of a working question category and replaced the category ID to the one that was deleted...it actually worked. However, when I tried saving it..it gave me an error: Can not find data record in database table context. Is that normal? That a deleted question category will remain in the DB like this?

 

ANYWAYS, what I can do is just change the question's category to a new one via phpmyadmin and resolve this issue but when you delete a quiz will it delete the quiz questions if the questions are in that specific quiz's category?

Thank you!

Average of ratings: -
In reply to Melissa Benson

Re: Will deleting a quiz delete the questions?

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

You are correct. If the question are stored in the part of the question bank specific to that quiz, then they will be deleted when you delete that quiz.

Well, they should be. From what you say it looks like that is a bug that stops that happening, and in this case, you are quite glad that bug exists.

In reply to Tim Hunt

Re: Will deleting a quiz delete the questions?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Tim, that sounds more like a feature than a bug to me. I have never experienced any questions being deleted as a result of deleting a quiz, and I'm not sure of the case for making that happen.  When you say "stored in the part of the question bank specific to that quiz", do you mean the part that is marked "Default for".$quizname

In reply to Marcus Green

Re: Will deleting a quiz delete the questions?

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

When you say "stored in the part of the question bank specific to that quiz", do you mean the part that is marked "Default for".$quizname - Yes, I do.

The normal thing is to store the questions in the area of the question bank linked to the course.

In reply to Tim Hunt

Re: Will deleting a quiz delete the questions?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Sorry to bang on about this, but is it your intention that there should be deletion of questions based on deleting quizzes when the questions are in the area of the question bank linked to the course?