From 3ea6d72ae0595551654bb7a28dcf0a6710079583 Mon Sep 17 00:00:00 2001 From: zty Date: Thu, 30 May 2024 13:41:22 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=87=BA=E5=85=B7=E5=9F=B9=E8=AE=AD?= =?UTF-8?q?=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/apps/exam/views.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/server/apps/exam/views.py b/server/apps/exam/views.py index ad87bbf..805b618 100644 --- a/server/apps/exam/views.py +++ b/server/apps/exam/views.py @@ -261,7 +261,6 @@ class PaperViewSet(ModelViewSet): sr.is_valid(raise_exception=True) vdata = sr.validated_data questions_ = vdata.pop('questions_') - print(questions_, '') vdata['update_by'] = request.user Paper.objects.filter(id=paper.id).update(**vdata) q_list = [] @@ -343,7 +342,6 @@ class PaperViewSet(ModelViewSet): id=questioncatdict[questioncat]) if Question.objects.filter(name=name, is_deleted=0, questioncat=cateobj).exists(): ids.append(Question.objects.get(name=name, is_deleted=0, questioncat=cateobj).id) - print(ids, '已存在') i = i + 1 continue if type == '单选': @@ -402,7 +400,6 @@ class PaperViewSet(ModelViewSet): i = i + 1 else: raise ParseError('excel解析失败') - print(ids, "--------------------") if ids: questions = Question.objects.filter(pk__in=ids) Serializer = QuestionSerializer(questions, many=True) @@ -569,12 +566,10 @@ class ExamRecordViewSet(ListModelMixin, DestroyModelMixin, RetrieveModelMixin, G for index, ad in enumerate(ads): ad.user_answer = questions_[index]['user_answer'] if ad.question.type == '多选': - print('多选', ad.question.right, ad.user_answer) if set(ad.question.right) == set(ad.user_answer): ad.is_right = True ad.score = ad.total_score else: - print('其他', ad.question.right, ad.user_answer) if ad.question.right == ad.user_answer: ad.is_right = True ad.score = ad.total_score @@ -584,7 +579,6 @@ class ExamRecordViewSet(ListModelMixin, DestroyModelMixin, RetrieveModelMixin, G raise ParseError('判卷失败, 请检查试卷:' + str(e)) er.score = total_score # if er.score > 0.6*er.total_score: - print('score:', er.score, 'paper_socre',paper.pass_score) if er.score >= paper.pass_score: er.is_pass = True # 如果是自动发证