stage 2: nice button
[edumed.git] / wtem / forms.py
index a434854..08a1e19 100644 (file)
@@ -61,6 +61,8 @@ class WTEMSingleForm(forms.ModelForm):
         if exercise_id != str(exercise['id']):
             raise ValueError('wrong exercise id')
         for answer in posted_answers.values():
+            if not answer.get('closed_part', True):
+                raise ValueError('no answer')
             answers[exercise_id] = answer
         submission.answers = json.dumps(answers)
         submission.save()