fix user scores for sba
This commit is contained in:
+6
-1
@@ -116,7 +116,12 @@ def exam_scores_cid_user(request, pk, cid=None, passcode=None):
|
|||||||
|
|
||||||
for q in questions:
|
for q in questions:
|
||||||
# Get user answer
|
# Get user answer
|
||||||
user_answer = q.cid_user_answers.filter(cid=cid).first()
|
if cid is not None:
|
||||||
|
user_answer = q.cid_user_answers.filter(cid=cid, exam__id=pk).first()
|
||||||
|
else:
|
||||||
|
user_answer = q.cid_user_answers.filter(
|
||||||
|
user=request.user, exam__id=pk
|
||||||
|
).first()
|
||||||
|
|
||||||
if user_answer is None:
|
if user_answer is None:
|
||||||
answer_score = 0
|
answer_score = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user