|
@@ -3,25 +3,21 @@ import json
|
|
|
import traceback
|
|
|
from django.utils import timezone
|
|
|
from rest_framework.decorators import action
|
|
|
-from rest_framework.serializers import ValidationError
|
|
|
-from rest_framework.views import APIView
|
|
|
from django.db import transaction
|
|
|
-from django.db.models import Q, Sum, F
|
|
|
+from django.db.models import F
|
|
|
from utils.custom_modelviewset import CustomModelViewSet
|
|
|
from utils import response_ok, response_error
|
|
|
-from utils.permission import IsAdministrator, IsStaff
|
|
|
+from utils.permission import IsStaff
|
|
|
from apps.examination.exam.serializers import *
|
|
|
from apps.examination.exam.filters import *
|
|
|
from apps.system.models import SysLog
|
|
|
-from apps.foundation.serializers import SubjectSerializer, ChapterSerializer, SubjectSimpleSerializer, \
|
|
|
- ChapterSimpleSerializer, Subject
|
|
|
+
|
|
|
from apps.examination.exam.models import ExamAnswerLog, ExamAnswerOptionLog, ExamAnswerFillLog
|
|
|
-from apps.examination.exampaper.models import ExamPaper, ExamPaperDetail, ExamQuestion
|
|
|
-from apps.examination.exampaper.filters import ExamPaperFilter
|
|
|
-from apps.examination.exampaper.serializers import StaffExamPaperSerializer
|
|
|
+from apps.examination.exampaper.models import ExamPaperDetail, ExamQuestion
|
|
|
from apps.examination.examquestion.models import ExamQuestionOption, ExamQuestionFill, ExamQuestionFeedback
|
|
|
from apps.examination.examquestion.serializers import ExamQuestionFeedbackSerializer
|
|
|
from apps.practise.errorbook.models import ErrorBook
|
|
|
+from utils.format import strftime
|
|
|
|
|
|
class ExamLogViewSet(CustomModelViewSet):
|
|
|
permission_classes = [IsStaff, ]
|
|
@@ -65,8 +61,8 @@ class ExamLogViewSet(CustomModelViewSet):
|
|
|
'id':exam_log.id,
|
|
|
'name':exam_log.exam.name,
|
|
|
'subject':exam_log.exam.subject.name,
|
|
|
- 'exam_time':exam_log.exam.exam_time,
|
|
|
- 'exam_end_time':exam_log.exam.exam_end_time,
|
|
|
+ 'exam_time':strftime(exam_log.exam.exam_time),
|
|
|
+ 'exam_end_time':strftime(exam_log.exam.exam_end_time),
|
|
|
'duration':exam_log.exam.duration,
|
|
|
}
|
|
|
data.append(item)
|