more Long improvements

This commit is contained in:
Ross
2023-05-22 13:29:07 +01:00
parent 4345f46615
commit ae670c738b
8 changed files with 136 additions and 87 deletions
+7 -4
View File
@@ -1687,7 +1687,7 @@ class ExamViews(View, LoginRequiredMixin):
else:
cid_user = None
exam.exam_user_status.create(
cid_user=cid, user_user=user, status="downloaded", extra="unbased"
cid_user=cid_user, user_user=user, status="downloaded", extra="unbased"
)
return JsonResponse(exam_json)
@@ -1725,6 +1725,7 @@ class ExamViews(View, LoginRequiredMixin):
question = get_object_or_404(self.Question, pk=sk)
exam = get_object_or_404(self.Exam, pk=pk)
if not exam.active and not self.check_user_access(request.user, pk):
raise Http404("No available exam")
@@ -1733,6 +1734,7 @@ class ExamViews(View, LoginRequiredMixin):
user_id = None
else:
user_id = request.user.pk
if not exam.check_cid_user(cid, passcode, request, user_id):
raise Http404("No available exam")
@@ -1795,10 +1797,11 @@ class ExamViews(View, LoginRequiredMixin):
if not user_answer or user_answer is None:
# skip if no answer
answers_marks.append(0)
score, text = q.get_unanswered_mark_and_text()
answers_marks.append(score)
# answers.append("")
answer_score = 0
ans = "Not answered"
answer_score = score
ans = text
else:
if exam.app_name == "rapids" and user_answer.normal:
ans = "Normal"