diff --git a/anatomy/templates/anatomy/exam_scores_user.html b/anatomy/templates/anatomy/exam_scores_user.html index 373115a8..b1baf829 100644 --- a/anatomy/templates/anatomy/exam_scores_user.html +++ b/anatomy/templates/anatomy/exam_scores_user.html @@ -112,12 +112,12 @@ $(document).ready(function () { $("#hide-viewer").on('click', function(){ $('.viewer-block .viewer-body').toggle(); }); - // Filter questions by score + // Filter questions by score using Bootstrap's d-none for consistent layout $("#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(); + if(val === 'all' || String(s) === String(val)) $(this).removeClass('d-none'); else $(this).addClass('d-none'); }); }); @@ -147,7 +147,7 @@ }); // auto-click first view button to populate viewer - const firstView = $(".view-question-button").first(); + const firstView = $(".view-question-button:visible").first(); if(firstView.length){ firstView.click(); } });