按题型排序

This commit is contained in:
caoqianming 2020-02-17 15:09:55 +08:00
parent 4d03740bc9
commit 7cef248038
1 changed files with 1 additions and 1 deletions

View File

@ -6005,7 +6005,7 @@ def apiexamtest(req):
elif a == 'detailtm':
id = req.GET.get('id')
test = ExamTest.objects.get(id=id)
objs = ExamPaperDetail.objects.filter(exampaper=test.exampaper).order_by('question_type').values(
objs = ExamPaperDetail.objects.filter(exampaper=test.exampaper).order_by('question__type').values(
'id', 'question__id', 'score', 'question__title', 'question__type', 'question__answer', 'question__right', 'question__resolution')
duration = test.duration
data = {'duration': duration, 'tms': list(objs)}