Steps to reproduce:
1. Create a category X with some questions in.
2. Add a random question to a test quiz using this category.
3. Attempt this quiz as a student.
4. Delete the questions from this category.
5. Review the student's attempt.
At step 5, you will see the error "This question has been deleted. Please contact your teacher" (which, incidentally, should have a full stop at the end.)
At step 4, any questions that are in use should not be really deleted, but instead should merely have their deleted flag set.