Refactor score filtering logic in exam scores user template for consistent layout
This commit is contained in:
@@ -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(); }
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user