I'm not sure this is how the Recycle bin is supposed to behave. It made hundreds of GB of copies of the whole question bank whenever a quiz is deleted, even if that quiz used a very small question in the bank.
I had the problem with my operational instance Moodle 3.10, so I created two new instances of Moodle 3.10 and 3.11 to test it. The same problem happened. Here is what I did and what happened:
- Created a new course and 3 questions, saved them in the question bank. Tip: The questions should have media, large enough (>100 MB) so that it would be easier later to find the backups that Recycle bin would create and store in moodledata/filedir.
- Created a quiz in the course, with an embedded answer cloze question. I could either use one of the questions I'd created in the bank earlier or create a new one.
- Deleted the quiz and waited for it to appear in the Recycle Bin.
- Went to Moodledata/filedir and sort the file according to size, download the largest one. (I had to create a new Moodle instance so that I would not be confused about which file was created by the Recycle Bin.)
- Changed the file extension to .tgz and extract it. Went to the files folder to find that the whole question bank with all the three questions added were there although none was used in the deleted quiz.
- I disabled the Recycle Bin and this stopped happening but that was not a good choice as teachers need the Recycle Bin.
- I unchecked the box for Include question bank in options for Backup configurations, and then I couldn't duplicate an activity anymore. Not a good choice, either.
- I had both the Recycle Bin and Include question bank check box enabled in my operational moodle instance and it's been creating dozens of copies of question banks and saving them in Moodledata/filedir. The size ranges from 500MB to 2GB each, depending on the size of the course in which that teachers have deleted the quiz. Basically, whenever a quiz is deleted, a new copy of the question bank is created. I have to sort and manually delete them.
I noticed that after 7 days, they would be moved to trashdir, stay for 4 days before being deleted. But I had to delete them manually because they were consuming too much space.
Why does it have to include the whole question bank, which can be GBs large, when backing up a quiz that has only a question KBs large?
Thanks for reading.