.
This commit is contained in:
@@ -1003,4 +1003,37 @@ def exam_scores_cid_user(request, pk, sk):
|
||||
"max_score": max_score,
|
||||
"answers_and_marks": answers_and_marks,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@login_required
|
||||
def exam_question_detail(request, pk, sk):
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
|
||||
question = exam.exam_questions.all()[sk]
|
||||
|
||||
exam_length = len(exam.exam_questions.all())
|
||||
|
||||
pos = exam.get_question_index(question) + 1
|
||||
|
||||
print(question.exams.through.sort_value)
|
||||
|
||||
previous = -1
|
||||
if sk > 0:
|
||||
previous = sk - 1
|
||||
next = sk + 1
|
||||
if sk == exam_length - 1:
|
||||
next = False
|
||||
|
||||
return render(
|
||||
request,
|
||||
"rapids/question_detail.html",
|
||||
{
|
||||
"question": question,
|
||||
"exam": exam,
|
||||
"next": next,
|
||||
"previous": previous,
|
||||
"exam_length": exam_length,
|
||||
"pos": pos,
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user