fix non exam mode
This commit is contained in:
+2
-2
@@ -1588,7 +1588,7 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
user_id = None
|
user_id = None
|
||||||
else:
|
else:
|
||||||
user_id = request.user.pk
|
user_id = request.user.pk
|
||||||
if not exam.check_cid_user(cid, passcode, request, user_id):
|
if self.exam_mode and not exam.check_cid_user(cid, passcode, request, user_id):
|
||||||
raise Http404("No available exam")
|
raise Http404("No available exam")
|
||||||
|
|
||||||
# exam_json_cache = cache.get("{}_exam_json_{}".format(self.app_name, pk))
|
# exam_json_cache = cache.get("{}_exam_json_{}".format(self.app_name, pk))
|
||||||
@@ -1650,7 +1650,7 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
"""
|
"""
|
||||||
exam = get_object_or_404(self.Exam, pk=pk)
|
exam = get_object_or_404(self.Exam, pk=pk)
|
||||||
|
|
||||||
if not exam.active and not self.check_user_access(request.user, pk):
|
if self.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
|
||||||
|
|||||||
Reference in New Issue
Block a user