This commit is contained in:
Ross
2021-08-19 12:54:10 +01:00
parent 39918829ba
commit 8198effa10
3 changed files with 12 additions and 10 deletions
+9 -7
View File
@@ -1132,16 +1132,18 @@ def user_answer_delete_multiple(request):
return JsonResponse({"status": "error"})
def question_review(request, pk, sk):
def question_review(request, pk):
"""
Return a json representation of the question when the exam is active
"""
exam = get_object_or_404(Exam, pk=pk)
if request.is_ajax():
exam = get_object_or_404(Exam, pk=pk)
if not exam.publish_results:
raise Http404
if not exam.publish_results:
raise Http404
question = exam.exam_questions.all()[sk]
question = exam.exam_questions.all()[request.POST["question_number"]]
question_json = question.get_question_json(based=False)
return JsonResponse(question_json)
question_json = question.get_question_json(based=False)
return JsonResponse(question_json)
return JsonResponse({"status": "error"})