fixed bug with deleting exams

- some foreign keys prevented exams from being fully deleted