@total@/@total@
@@ -367,6 +386,23 @@
document.querySelector("#total").textContent = total;
document.querySelector("#total-shown").textContent = totalShown;
}
+ for (f of document.querySelectorAll("input[name=timeframe]")) {
+ f.addEventListener('change', function(e) {
+ document.querySelector("[name=start_date]").value =
+ this.getAttribute("data-start-date");
+ document.querySelector("[name=end_date]").value =
+ this.getAttribute("data-end-date");
+ document.querySelector("[name=start_time]").value =
+ this.getAttribute("data-start-time");
+ document.querySelector("[name=end_time]").value =
+ this.getAttribute("data-end-time");
+ });
+ }
+ for (f of dateFilters) {
+ f.addEventListener('change', function(e) {
+ document.querySelector("input[name=timeframe][value=none]").checked = false;
+ });
+ }
for (f of document.querySelectorAll("[name=filters] input")) {
f.addEventListener('change', function(e) {
hideFiltered();
Index: openacs-4/packages/proctoring-support/lib/proctoring-display.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/lib/proctoring-display.tcl,v
diff -u -r1.1.2.15 -r1.1.2.16
--- openacs-4/packages/proctoring-support/lib/proctoring-display.tcl 22 Feb 2022 14:30:06 -0000 1.1.2.15
+++ openacs-4/packages/proctoring-support/lib/proctoring-display.tcl 23 Feb 2022 15:07:53 -0000 1.1.2.16
@@ -112,6 +112,31 @@
set back_url $base_url
+ # Populate a multirow of presets for the time filters, which
+ # can also come from other packages.
+ db_multirow timeframes get_timeframes {
+ select '#proctoring-support.current_proctoring_configuration_timeframe_label#' as name,
+ start_date,
+ start_time,
+ end_date,
+ end_time
+ from proctoring_objects
+ where object_id = :object_id
+ }
+
+ foreach result [callback ::proctoring::callback::object::timeframes \
+ -object_id $object_id] {
+ foreach timeframe $result {
+ ::template::multirow append \
+ [dict get $timeframe name] \
+ [dict get $timeframe start_date] \
+ [dict get $timeframe start_time] \
+ [dict get $timeframe end_date] \
+ [dict get $timeframe end_time]
+ }
+ }
+ template::multirow sort timeframes start_date start time end_date end_time name
+
# Desktop and camera pictures are produced at the same time,
# even if they might not have the same timestamp, so they are
# put together in a single row, based on the order in which
Index: openacs-4/packages/proctoring-support/tcl/proctoring-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/tcl/proctoring-callback-procs.tcl,v
diff -u -r1.1.2.4 -r1.1.2.5
--- openacs-4/packages/proctoring-support/tcl/proctoring-callback-procs.tcl 10 Feb 2022 13:16:36 -0000 1.1.2.4
+++ openacs-4/packages/proctoring-support/tcl/proctoring-callback-procs.tcl 23 Feb 2022 15:07:53 -0000 1.1.2.5
@@ -84,3 +84,24 @@
@param artifact_id id of the artifact
} -
+
+namespace eval ::proctoring::callback {}
+namespace eval ::proctoring::callback::object {}
+
+ad_proc -public -callback ::proctoring::callback::object::timeframes {
+ -object_id:required
+} {
+ Implementations of this hook can return a list of timeframes,
+ retrieved by package-specific logic (e.g. the timeframe of a XoWF
+ InclassExam) that we can use to e.g. filter the list of proctoring
+ artifacts via presets.
+
+ @param object_id id of the proctored object
+
+ @return a list of dicts with fields "name", "start_date",
+ "start_time", "end_date" and "end_time". Date fields are
+ dates in ISO format such as "2016-09-07", time fields are
+ time formats such as "08:00" or other value accepted by a
+ time HTML input field.
+} -
+