diff --git a/physics/templates/physics/exam_take.html b/physics/templates/physics/exam_take.html index 6bd763d1..f3f146af 100755 --- a/physics/templates/physics/exam_take.html +++ b/physics/templates/physics/exam_take.html @@ -162,12 +162,10 @@ } .physics-answer-list input:checked::after { - transform: translateY(-20px); margin-left: 20px; content: "True" } .physics-answer-list input:not(:checked)::after { - margin-top: -5px; margin-left: 20px; content: "False" } diff --git a/physics/views.py b/physics/views.py index b87433d4..d06f2da2 100644 --- a/physics/views.py +++ b/physics/views.py @@ -94,7 +94,7 @@ def exam_scores_cid(request, pk): questions = exam.exam_questions.all() cids = ( - CidUserAnswer.objects.filter(question__in=questions) + CidUserAnswer.objects.filter(question__in=questions, exam__id=pk) .order_by("cid") .values_list("cid", flat=True) .distinct() @@ -114,7 +114,7 @@ def exam_scores_cid(request, pk): user_names[cid] = cid for q in questions: # Get user answer - s = q.cid_user_answers.filter(cid=cid).first() + s = q.cid_user_answers.filter(cid=cid, exam__id=pk).first() if not s: # skip if no answer user_answers_marks[cid].append(0) @@ -207,7 +207,7 @@ def exam_scores_cid_user(request, pk, sk): for q in questions: # Get user answer - user_answer = q.cid_user_answers.filter(cid=cid).first() + user_answer = q.cid_user_answers.filter(cid=cid, exam__id=pk).first() ans = user_answer.get_answers()