Selaa lähdekoodia

考试端 优化

wushaodong 3 vuotta sitten
vanhempi
sitoutus
35217e4c71

+ 1 - 1
apps/api/staff/exam/views.py

@@ -240,7 +240,7 @@ class ExamLogViewSet(CustomModelViewSet):
                 # 填空题
                 fill_questions_list = []
                 for fill in questions.filter(question__type=ExamQuestion.FILL):
-                    answers = ExamAnswerFillLog.objects.filter(main__main=instance, main__detail=multiple).first()
+                    answers = ExamAnswerFillLog.objects.filter(main__main=instance, main__detail=fill).first()
                     fill_questions_list.append(
                         {
                             'question_id': fill,

+ 1 - 0
apps/api/staff/mock/views.py

@@ -166,6 +166,7 @@ class ExamLogViewSet(CustomModelViewSet):
                         'id': detail.id,
                         'question': question.id,
                         'title': question.title,
+                        'exam_time': instance.exam_time.strftime('%Y-%m-%d %H:%M:%S'),
                         'next_type': question.type,  # 下一题习题类别
                         'next_number': detail.order + 1,  # 下下一题序号,
                         'option': [],

+ 1 - 0
apps/api/staff/practise/views.py

@@ -156,6 +156,7 @@ class PractiseLogViewSet(CustomModelViewSet):
                     question_data = {
                         'id': question.id,
                         'title': question.title,
+                        'create_time': instance.create_time.strftime('%Y-%m-%d %H:%M:%S'),
                         'next_type': question.type,  # 下一题习题类别
                         'next_number': int(next_number) + 1,  # 下下一题序号,
                         'option': [],

+ 1 - 1
apps/examination/exam/serializers.py

@@ -78,7 +78,7 @@ class StaffExamLogSerializer(serializers.ModelSerializer):
 
     class Meta:
         model = ExamLog
-        fields = ('id', 'type', 'exampaper', 'user', 'exam_time', 'exampaper_name', 'exam_time', 'submit_time',
+        fields = ('id', 'type', 'exampaper', 'user', 'exam_time', 'exampaper_name', 'submit_time',
                   'scores', 'right_count','wrong_count','rank',)
 
     def get_right_count(self, obj):