Index: openacs-4/packages/proctoring-support/lib/proctoring-upload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/lib/Attic/proctoring-upload.tcl,v diff -u -N -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/proctoring-support/lib/proctoring-upload.tcl 11 Aug 2020 08:41:41 -0000 1.1.2.3 +++ openacs-4/packages/proctoring-support/lib/proctoring-upload.tcl 1 Sep 2020 11:34:53 -0000 1.1.2.4 @@ -3,13 +3,30 @@ Implements the upload backend for proctoring, which can be used as is or inside e.g. an object method. + @param notify_p enable websocket notifications on two + subscriptions named proctoring- and + proctoring--, notifying about + uploads on the whole proctored object and on the + single user respectively. + @param check_active_p when enabled, upload backend will use data + stored in the proctoring datamodel to check + if proctoring is still active on the + object. If it is not, the include will + return "OFF" as a res ponse, informing the + client side that proctoring can be + interrupted. + + @return 200/OK on success, 500/KO on failure, 200/OFF on a correct + request when proctoring is not active anymore and the + check_active_p flag is enabled. } { name:oneof(camera|desktop),notnull type:oneof(image|audio),notnull object_id:naturalnum,notnull file file.tmpfile {notify_p:boolean false} + {check_active_p:boolean true} } auth::require_login @@ -31,7 +48,7 @@ ns_log warning "Proctoring: user $user_id uploaded a non-$type ($mime_type) file for object $object_id" ns_return 500 text/plain "KO" ad_script_abort -} elseif {![::proctoring::active_p -object_id $object_id]} { +} elseif {$check_active_p && ![::proctoring::active_p -object_id $object_id]} { ns_return 200 text/plain "OFF" ad_script_abort }