Index: openacs-4/packages/xowf/lib/inclass-exam.wf
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/Attic/inclass-exam.wf,v
diff -u -N -r1.1.2.10 -r1.1.2.11
--- openacs-4/packages/xowf/lib/inclass-exam.wf 25 Mar 2020 16:24:00 -0000 1.1.2.10
+++ openacs-4/packages/xowf/lib/inclass-exam.wf 1 Apr 2020 15:03:43 -0000 1.1.2.11
@@ -36,6 +36,7 @@
# The policy has to allow the following methods on FormPages:
#
# - "answer" (for students),
+# - "proctor" (for students),
# - "edit" (for students),
# - "poll" (for teachers),
# - "print-answers" (for teachers),
@@ -141,6 +142,8 @@
#:log fullQuestionForm=$fullQuestionForm
set text "
$title
"
set menu ""
+ set proctoring [$obj property proctoring]
+ if {$proctoring eq ""} {set proctoring 0}
set wf [xowf::test_item::answer_manager get_answer_wf $obj]
if {$wf eq ""} {
@@ -159,6 +162,20 @@
}]
set aLink [$obj pretty_link -query m=answer]
+ if {$proctoring} {
+ #
+ # send link via "m=proctor"
+ #
+ set tLink [export_vars -base [$obj pretty_link] {
+ {m proctor} {link "$tLink&p.proctor=1"}
+ }]
+ #
+ # We could send answer link ("aLink") as well this way, but we
+ # want to keep the link short, therefore we handle the proctor
+ # link inside the www-answer method.
+ #
+ }
+
#
# If there are answers, include the full menu.
#
@@ -456,7 +473,15 @@
util_user_message -html -message "Cannot start answer workflow in this state"
} else {
set wf [xowf::test_item::answer_manager get_answer_wf [self]]
- $wf www-create-or-use -parent_id [:item_id]
+ set proctoring [:property proctoring]
+ if {$proctoring ne "" & $proctoring} {
+ set cLink [export_vars -base [:pretty_link] {
+ {m proctor} {link "[$wf pretty_link -query m=create-or-use&p.proctor=1]"}
+ }]
+ ::${:package_id} returnredirect $cLink
+ } else {
+ $wf www-create-or-use -parent_id [:item_id]
+ }
}
}
@@ -468,6 +493,25 @@
ad_script_abort
}
+ :proc www-proctor {} {
+ #
+ # Redirect the exam to an iframe for implementing proctoring. The
+ # basic idea is that the web application turns on the camera and
+ # keeps the iframe while the user is iterating throught the exam.
+ # The line "You are being proctored!
" is just a
+ # placeholder and has to be replaced with real code.
+ #
+ set link [${:package_id} query_parameter link:localurl ""]
+
+ ::xo::cc set_parameter template_file view-plain-master
+ ::xo::cc set_parameter MenuBar 0
+
+ return [:www-view [subst {
+ You are being proctored!
+
+ }]]
+ }
+
########################################################################
# AJAX call "poll"
#