- assert type(posted_answers) == dict, 'answers not dict'
- assert len(posted_answers) == 1, 'answers not single'
- exercise_id = posted_answers.keys()[0]
+ if type(posted_answers) != dict:
+ raise ValueError('answers not dict')
+ if len(posted_answers) != 1:
+ raise ValueError('answers not single')
+ exercise_id, answer = posted_answers.items()[0]
+ # multipost
+ if answers.get(exercise_id) == answer:
+ return