Index: openacs-4/packages/xowf/xowf.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/xowf.info,v diff -u -r1.12.2.109 -r1.12.2.110 --- openacs-4/packages/xowf/xowf.info 29 Feb 2024 13:22:29 -0000 1.12.2.109 +++ openacs-4/packages/xowf/xowf.info 23 Apr 2024 11:06:28 -0000 1.12.2.110 @@ -10,30 +10,30 @@ t xowf - + Gustaf Neumann XoWiki Content Flow - an XoWiki based workflow system implementing state-based behavior of wiki pages and forms - 2023-07-11 + 2024-04-23 WU Vienna BSD-Style 2 - - - - + + + + - - - + + + - + Index: openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml,v diff -u -r1.2.2.89 -r1.2.2.90 --- openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 24 Nov 2023 13:49:48 -0000 1.2.2.89 +++ openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 23 Apr 2024 11:06:28 -0000 1.2.2.90 @@ -233,6 +233,7 @@ nach Punkten Single-Choice-Frage Inhalte durchsuchen + Nur ohne Bewertung Sekunde Sekunden Sicherheitseinstellungen Index: openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml,v diff -u -r1.2.2.95 -r1.2.2.96 --- openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 2 Feb 2024 12:04:17 -0000 1.2.2.95 +++ openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 23 Apr 2024 11:06:28 -0000 1.2.2.96 @@ -240,6 +240,7 @@ by points Single Choice Question Search in content + Only not graded Second Seconds Security Configuration Index: openacs-4/packages/xowf/catalog/xowf.it_IT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/catalog/xowf.it_IT.ISO-8859-1.xml,v diff -u -r1.2.2.13 -r1.2.2.14 --- openacs-4/packages/xowf/catalog/xowf.it_IT.ISO-8859-1.xml 29 Feb 2024 13:22:29 -0000 1.2.2.13 +++ openacs-4/packages/xowf/catalog/xowf.it_IT.ISO-8859-1.xml 23 Apr 2024 11:06:28 -0000 1.2.2.14 @@ -241,6 +241,7 @@ a punti Domanda a risposta singola Cerca nel contenuto + Solo senza un voto Secondo Secondi Sicurezza Index: openacs-4/packages/xowf/tcl/test-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/test-item-procs.tcl,v diff -u -r1.7.2.285 -r1.7.2.286 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 24 Nov 2023 14:50:45 -0000 1.7.2.285 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 23 Apr 2024 11:06:28 -0000 1.7.2.286 @@ -3360,12 +3360,19 @@ -preventdefault=true \ -script "handleSearch();" + template::add_event_listener \ + -id search-not-graded \ + -event change \ + -preventdefault=true \ + -script "filterNotGraded();" + template::head::add_javascript -order 100 -src "/resources/xowf/inclass-exam.js" set HTML [subst {
Filter: #xowf.Search_in_content# + #xowf.Search_not_graded#
[template::collect_body_scripts] Index: openacs-4/packages/xowf/www/resources/inclass-exam.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/www/resources/inclass-exam.js,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/xowf/www/resources/inclass-exam.js 5 Apr 2024 08:53:16 -0000 1.1.2.2 +++ openacs-4/packages/xowf/www/resources/inclass-exam.js 23 Apr 2024 11:06:28 -0000 1.1.2.3 @@ -1,3 +1,18 @@ +function traverseQuestions (callback) { + for (const question of document.querySelectorAll('.test-item')) { + callback(question); + } +} + +function filterNotGraded () { + const checked = document.querySelector('#search-not-graded').checked; + traverseQuestions(function (question) { + const grade = question.querySelector('.grading-box > .points'); + const isGraded = grade && grade.textContent !== ''; + question.style.display = checked && isGraded ? 'none' : 'block'; + }); +} + function handleSearch () { var searchTerm_orig = document.getElementById("search-question-string").value; var searchTerm = searchTerm_orig; @@ -29,23 +44,21 @@ } var searchContentChecked = document.getElementById("search-content").checked; - var questions = document.getElementsByClassName('test-item'); - for (var i = 0; i < questions.length; i++) { - question_info = questions.item(i).getAttribute('data-item_type'); - if (questions.item(i).querySelector('.grading-box') != null) { - var text = questions.item(i).querySelector('.grading-box').dataset.title; + traverseQuestions(function (question) { + // question_info = question.getAttribute('data-item_type'); + if (question.querySelector('.grading-box') != null) { + var text = question.querySelector('.grading-box').dataset.title; } else { //fallback if no grading-box is rendered - var text = questions.item(i).textContent; + var text = question.textContent; } if (searchContentChecked) { - text = questions.item(i).textContent; + text = question.textContent; } if (searchTermRegex == '' || text.match(searchTermRegex)) { - questions.item(i).style.display = 'block'; + question.style.display = 'block'; } else { - questions.item(i).style.display = 'none'; + question.style.display = 'none'; } - } - return; + }); }