Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 5f5b142

Browse files
committed
Add: simple filter to show 0 or ungraded questions
1 parent d371097 commit 5f5b142

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

static/js/admin.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,23 @@ function gradeIndividualItem() {
3131

3232
$(rightSideDiv)[0].style.visibility = "visible";
3333
rightSideDiv.html(""); //empty it out
34+
rightSideDiv.html("<input id='filterto0' type=checkbox unchecked/>Click to only show questions with a grade of 0 or not graded<br/>")
35+
let rsd = document.querySelector("#filterto0");
36+
rsd.addEventListener('change',
37+
function () {
38+
let gPanels = document.querySelectorAll(".loading");
39+
for (let panel of gPanels) {
40+
let v = panel.querySelector("#gradingform").querySelector("#input-grade").value;
41+
if (rsd.checked) {
42+
if (v != 0 || v != "") {
43+
panel.style.display = "none";
44+
}
45+
} else {
46+
panel.style.display = "block";
47+
}
48+
}
49+
});
50+
3451
//Not sure if questions or students should be the outer loop
3552
var mg = false;
3653
if (questions.length * sstudents.length > 1) {

0 commit comments

Comments
 (0)