This commit is contained in:
Ross
2023-02-20 10:05:57 +00:00
parent 850506a9b8
commit 1b690f93b3
+4 -1
View File
@@ -1594,6 +1594,7 @@ class ExamViews(View, LoginRequiredMixin):
# exam_json_cache = cache.get("{}_exam_json_{}".format(self.app_name, pk)) # exam_json_cache = cache.get("{}_exam_json_{}".format(self.app_name, pk))
# Log exam access # Log exam access
if exam.exam_mode:
user = request.user user = request.user
if cid is not None: if cid is not None:
user = None user = None
@@ -1650,7 +1651,7 @@ class ExamViews(View, LoginRequiredMixin):
""" """
exam = get_object_or_404(self.Exam, pk=pk) exam = get_object_or_404(self.Exam, pk=pk)
if self.exam_mode and not exam.active and not self.check_user_access(request.user, pk): if exam.exam_mode and not exam.active and not self.check_user_access(request.user, pk):
raise Http404("No available exam") raise Http404("No available exam")
# Check access for users # Check access for users
@@ -1667,7 +1668,9 @@ class ExamViews(View, LoginRequiredMixin):
exam_json["generated"] = time.isoformat() exam_json["generated"] = time.isoformat()
exam_json["exam_json_id"] = exam.exam_json_id exam_json["exam_json_id"] = exam.exam_json_id
# exam_json["exam_active"] = False # exam_json["exam_active"] = False
# Log exam access # Log exam access
if exam.exam_mode:
user = request.user user = request.user
if cid is not None: if cid is not None:
user = None user = None