From eb8fe58cf7cf2431e956ff277344df2581a4b2e0 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 19 Jan 2026 12:51:02 +0000 Subject: [PATCH] Refactor exam scores user template to implement question filtering by score selection --- .../templates/anatomy/exam_scores_user.html | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/anatomy/templates/anatomy/exam_scores_user.html b/anatomy/templates/anatomy/exam_scores_user.html index 693b9ace..47a8d160 100644 --- a/anatomy/templates/anatomy/exam_scores_user.html +++ b/anatomy/templates/anatomy/exam_scores_user.html @@ -11,18 +11,9 @@
Filter questions by marks
@@ -55,7 +46,6 @@
{% if exam.publish_results %} - {% else %} {% endif %} @@ -120,6 +110,15 @@ $(document).ready(function () { $("#hide-viewer").on('click', function(){ $('.viewer-block .viewer-body').toggle(); }); + // Filter questions by score + $("#filter-score").on('change', function(){ + const val = $(this).val(); + $(".list-group-item[data-score]").each(function(){ + const s = $(this).data('score'); + if(val === 'all' || String(s) === String(val)) $(this).show(); else $(this).hide(); + }); + }); + $(".view-question-button").on("click", function (e) { question_number = e.currentTarget.dataset.qn; $("#single-dicom-viewer").empty();