improve user score pages
This commit is contained in:
+13
-6
@@ -656,11 +656,12 @@ def exam_scores_cid_user(request, pk, sk):
|
||||
# skip if no answer
|
||||
answers_marks.append(0)
|
||||
answers.append("")
|
||||
continue
|
||||
answer_score = 0
|
||||
ans = "Not answered"
|
||||
else:
|
||||
ans = user_answer.answer
|
||||
|
||||
ans = user_answer.answer
|
||||
|
||||
answer_score = user_answer.get_answer_score()
|
||||
answer_score = user_answer.get_answer_score()
|
||||
|
||||
correct_answer = q.GetPrimaryAnswer()
|
||||
answers.append(ans)
|
||||
@@ -669,7 +670,7 @@ def exam_scores_cid_user(request, pk, sk):
|
||||
|
||||
total_score = sum(answers_marks)
|
||||
|
||||
total = len(questions)
|
||||
max_score = len(questions) * 2
|
||||
|
||||
return render(
|
||||
request,
|
||||
@@ -681,10 +682,16 @@ def exam_scores_cid_user(request, pk, sk):
|
||||
"answers": answers,
|
||||
"answers_marks": answers_marks,
|
||||
"total_score": total_score,
|
||||
"max_score": max_score,
|
||||
"answers_and_marks": answers_and_marks,
|
||||
},
|
||||
)
|
||||
|
||||
def cid_selector(request):
|
||||
return render(
|
||||
request,
|
||||
"anatomy/cid_selector.html",
|
||||
)
|
||||
|
||||
@login_required
|
||||
def exam_scores(request, pk):
|
||||
@@ -748,7 +755,7 @@ def cid_scores(request, pk):
|
||||
|
||||
|
||||
if not answers:
|
||||
return Http404("cid not found")
|
||||
raise Http404("cid not found")
|
||||
|
||||
exam_ids = answers.values_list("exam").distinct()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user