From 10104b88f64c53990df231bff60e5117430c97ec Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 14 Nov 2022 14:33:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E5=8D=B7bug2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/apps/exam/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/apps/exam/views.py b/server/apps/exam/views.py index 0058199..30d6f6c 100644 --- a/server/apps/exam/views.py +++ b/server/apps/exam/views.py @@ -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()