.
This commit is contained in:
+6
-1
@@ -911,6 +911,11 @@ def exam_scores_cid_user(request, pk, cid):
|
||||
answers_marks = []
|
||||
answers = []
|
||||
|
||||
|
||||
view_all_results = False
|
||||
if request.user.groups.filter(name="view_all_results").exists():
|
||||
view_all_results = True
|
||||
|
||||
for q in questions:
|
||||
# Get user answer
|
||||
user_answer = q.cid_user_answers.filter(cid=cid, exam__id=pk).first()
|
||||
@@ -930,7 +935,7 @@ def exam_scores_cid_user(request, pk, cid):
|
||||
|
||||
correct_answer = q.get_primary_answer()
|
||||
|
||||
if not exam.publish_results:
|
||||
if not exam.publish_results and not view_all_results:
|
||||
correct_answer = "*****"
|
||||
answer_score = 0
|
||||
answers.append(ans)
|
||||
|
||||
Reference in New Issue
Block a user