.
This commit is contained in:
+3
-2
@@ -369,14 +369,15 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
return JsonResponse(exam_json)
|
||||
|
||||
def exam_question_json(self, request, pk, sk):
|
||||
question = get_object_or_404(self.Question, pk=sk)
|
||||
exam = get_object_or_404(self.Exam, pk=pk)
|
||||
|
||||
if not exam.active:
|
||||
if not question.active:
|
||||
raise Http404("No available exam")
|
||||
|
||||
question_json_cache = cache.get("{}_question_json_{}".format(self.app_name, sk))
|
||||
|
||||
if question_json_cache is not None and not exam.recreate_json:
|
||||
if question_json_cache is not None and not question.recreate_json:
|
||||
question_json_cache["cached"] = True
|
||||
return JsonResponse(question_json_cache)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user