diff --git a/apps/edu/views.py b/apps/edu/views.py index 87c5f830..5f6919b0 100644 --- a/apps/edu/views.py +++ b/apps/edu/views.py @@ -169,13 +169,13 @@ class ExamRecordViewSet(ListModelMixin, DestroyModelMixin, RetrieveModelMixin, C serializer = ExamRecordSubmitSerializer(data = request.data) serializer.is_valid(raise_exception=True) vdata = serializer.validated_data - questions_ = vdata['detail_'] + detail = vdata['detail'] # 后端判卷 ads = AnswerDetail.objects.select_related('question').filter(examrecord=er).order_by('id') total_score = 0 try: for index, ad in enumerate(ads): - ad.user_answer = questions_[index]['user_answer'] + ad.user_answer = detail[index]['user_answer'] if ad.question.type == '多选': if set(ad.question.right) == set(ad.user_answer): ad.is_right = True diff --git a/apps/utils/tasks.py b/apps/utils/tasks.py index 77b9490e..6af65d17 100644 --- a/apps/utils/tasks.py +++ b/apps/utils/tasks.py @@ -18,7 +18,7 @@ def send_mail_task(**args): settings.SYS_NAME, settings.SYS_VERSION, config['base']['base_name_short'], subject) args['from_email'] = args.get('from_email', settings.EMAIL_HOST_USER) args['recipient_list'] = args.get( - 'recipient_list', [settings.EMAIL_HOST_USER]) + 'recipient_list', settings.EMAIL_DEVELOPERS if hasattr(settings, 'EMAIL_DEVELOPERS') else [settings.EMAIL_HOST_USER]) cache_key = f'error_mail_{subject}' email_tuple = cache.get(cache_key) if email_tuple is None: