diff --git a/zesje/api/feedback.py b/zesje/api/feedback.py index f81ef406b495952175219a62175dacfa44cc9f35..0ed472b1da1d49b9a098f1fb4312a0878f56414a 100644 --- a/zesje/api/feedback.py +++ b/zesje/api/feedback.py @@ -141,6 +141,12 @@ class Feedback(Resource): # Delete mc_options associated with this feedback option if fb.mc_option: + + # Check if the exam with this feedback option + if fb.problem.exam.finalized: + return dict(status=401, message='Cannot delete feedback option' + + ' attached to a multiple choice option in a finalized exam.'), 401 + db.session.delete(fb.mc_option) db.session.commit()