This commit is contained in:
Ross
2021-09-09 12:56:43 +01:00
parent 226058651c
commit 343cc9cb9a
3 changed files with 50 additions and 12 deletions
+17 -1
View File
@@ -1142,4 +1142,20 @@ class SeriesImagesZipView(SuperuserRequiredMixin, BaseZipView):
def get_files(self):
series = LongSeries.objects.get(pk=self.kwargs['pk'])
return [i.image.file for i in series.images.all()]
return [i.image.file for i in series.images.all()]
def question_review(request, pk):
"""
Return a json representation of the question when the exam is active
"""
if request.is_ajax():
exam = get_object_or_404(Exam, pk=pk)
if not exam.publish_results:
raise Http404
question = exam.exam_questions.all()[int(request.POST["question_number"])]
question_json = question.get_question_json(based=False)
return JsonResponse(question_json)
return JsonResponse({"status": "error"})