.
This commit is contained in:
+3
-3
@@ -787,7 +787,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()
|
||||
@@ -807,7 +807,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
|
||||
@@ -901,7 +901,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()
|
||||
|
||||
if not user_answer or user_answer is None:
|
||||
# skip if no answer
|
||||
|
||||
Reference in New Issue
Block a user