判卷bug2

This commit is contained in:
caoqianming 2022-11-14 14:33:53 +08:00
parent 4f1d695e5f
commit 10104b88f6
1 changed files with 3 additions and 3 deletions

View File

@ -399,12 +399,12 @@ class ExamRecordViewSet(ListModelMixin, DestroyModelMixin, GenericViewSet):
try:
for index, ad in enumerate(ads):
ad.user_answer = questions_[index]['user_answer']
if ad.question__type == '多选':
if set(ad.question__right) == set(ad.user_answer):
if ad.question.type == '多选':
if set(ad.question.right) == set(ad.user_answer):
ad.is_right = True
ad.score = ad.total_score
else:
if ad.question__right == ad.user_answer:
if ad.question.right == ad.user_answer:
ad.is_right = True
ad.score = ad.total_score
ad.save()