Unmarked
-
{{ exam_response_score_counts.empty|default:0 }} {{ exam_response_score_pcts.empty|default:0 }}%
+
{{ exam_response_score_counts|get_item:'empty'|default:0 }} {{ exam_response_score_pcts|get_item:'empty'|default:0 }}%
diff --git a/anatomy/views.py b/anatomy/views.py
index 146c1016..9240e330 100644
--- a/anatomy/views.py
+++ b/anatomy/views.py
@@ -376,7 +376,7 @@ def exam_review_question_summary(request, pk: int, q_index: int):
top_answers = []
for ans, meta in answer_map.items():
# pick dominant score by highest count; tie-break prefer higher numeric score
- score_counts = meta["score_counts"]
+ ans_score_counts = meta["score_counts"]
# sort by (count desc, score desc) where 'empty' maps to -1
def score_key(item):
s, c = item
@@ -390,7 +390,7 @@ def exam_review_question_summary(request, pk: int, q_index: int):
s_val = -1
return (c, s_val)
- dominant = max(score_counts.items(), key=score_key)[0]
+ dominant = max(ans_score_counts.items(), key=score_key)[0]
top_answers.append({"answer_compare": ans, "count": meta["total"], "dominant_score": dominant})
top_answers.sort(key=lambda x: x["count"], reverse=True)