|
@@ -178,7 +178,7 @@ class ExamLogViewSet(CustomModelViewSet):
|
|
|
)
|
|
|
single_questions_list = []
|
|
|
for single in questions.filter(question__type=ExamQuestion.SINGLE):
|
|
|
- answer_log = ExamAnswerLog.objects.filter(main=instance, detail=single)
|
|
|
+ answer_log = ExamAnswerLog.objects.filter(main=instance, detail=single['id'])
|
|
|
single_questions_list.append(
|
|
|
{
|
|
|
'question_id': single['id'],
|
|
@@ -189,7 +189,7 @@ class ExamLogViewSet(CustomModelViewSet):
|
|
|
# 多选题
|
|
|
multiple_questions_list = []
|
|
|
for multiple in questions.filter(question__type=ExamQuestion.MULTIPLE):
|
|
|
- answer_log = ExamAnswerLog.objects.filter(main=instance, detail=multiple)
|
|
|
+ answer_log = ExamAnswerLog.objects.filter(main=instance, detail=multiple['id'])
|
|
|
multiple_questions_list.append(
|
|
|
{
|
|
|
'question_id': multiple['id'],
|
|
@@ -200,7 +200,7 @@ class ExamLogViewSet(CustomModelViewSet):
|
|
|
# 填空题
|
|
|
fill_questions_list = []
|
|
|
for fill in questions.filter(question__type=ExamQuestion.FILL):
|
|
|
- answer_log = ExamAnswerLog.objects.filter(main=instance, detail=fill)
|
|
|
+ answer_log = ExamAnswerLog.objects.filter(main=instance, detail=fill['id'])
|
|
|
fill_questions_list.append(
|
|
|
{
|
|
|
'question_id': fill['id'],
|
|
@@ -211,7 +211,7 @@ class ExamLogViewSet(CustomModelViewSet):
|
|
|
# 判断题
|
|
|
judgment_questions_list = []
|
|
|
for judgment in questions.filter(question__type=ExamQuestion.JUDGMENT):
|
|
|
- answer_log = ExamAnswerLog.objects.filter(main=instance, detail=judgment)
|
|
|
+ answer_log = ExamAnswerLog.objects.filter(main=instance, detail=judgment['id'])
|
|
|
judgment_questions_list.append(
|
|
|
{
|
|
|
'question_id': judgment['id'],
|