.
This commit is contained in:
+3
-3
@@ -453,7 +453,7 @@ def exam_scores_cid(request, pk):
|
|||||||
questions = exam.exam_questions.all()
|
questions = exam.exam_questions.all()
|
||||||
|
|
||||||
cids = (
|
cids = (
|
||||||
CidUserAnswer.objects.filter(question__in=questions)
|
CidUserAnswer.objects.filter(question__in=questions, exam__id=pk)
|
||||||
.order_by("cid")
|
.order_by("cid")
|
||||||
.values_list("cid", flat=True)
|
.values_list("cid", flat=True)
|
||||||
.distinct()
|
.distinct()
|
||||||
@@ -473,7 +473,7 @@ def exam_scores_cid(request, pk):
|
|||||||
user_names[cid] = cid
|
user_names[cid] = cid
|
||||||
for q in questions:
|
for q in questions:
|
||||||
# Get user answer
|
# 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:
|
if not s:
|
||||||
# skip if no answer
|
# skip if no answer
|
||||||
user_answers_marks[cid].append(0)
|
user_answers_marks[cid].append(0)
|
||||||
@@ -564,7 +564,7 @@ def exam_scores_cid_user(request, pk, sk):
|
|||||||
|
|
||||||
for q in questions:
|
for q in questions:
|
||||||
# Get user answer
|
# 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:
|
if not user_answer:
|
||||||
# skip if no answer
|
# skip if no answer
|
||||||
answers_marks.append(0)
|
answers_marks.append(0)
|
||||||
|
|||||||
+3
-3
@@ -787,7 +787,7 @@ def exam_scores_cid(request, pk):
|
|||||||
questions = exam.exam_questions.all()
|
questions = exam.exam_questions.all()
|
||||||
|
|
||||||
cids = (
|
cids = (
|
||||||
CidUserAnswer.objects.filter(question__in=questions)
|
CidUserAnswer.objects.filter(question__in=questions, exam__id=pk)
|
||||||
.order_by("cid")
|
.order_by("cid")
|
||||||
.values_list("cid", flat=True)
|
.values_list("cid", flat=True)
|
||||||
.distinct()
|
.distinct()
|
||||||
@@ -807,7 +807,7 @@ def exam_scores_cid(request, pk):
|
|||||||
user_names[cid] = cid
|
user_names[cid] = cid
|
||||||
for q in questions:
|
for q in questions:
|
||||||
# Get user answer
|
# 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:
|
if not s:
|
||||||
# skip if no answer
|
# skip if no answer
|
||||||
@@ -901,7 +901,7 @@ def exam_scores_cid_user(request, pk, sk):
|
|||||||
|
|
||||||
for q in questions:
|
for q in questions:
|
||||||
# Get user answer
|
# 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:
|
if not user_answer or user_answer is None:
|
||||||
# skip if no answer
|
# skip if no answer
|
||||||
|
|||||||
Reference in New Issue
Block a user