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.35 -r1.1.2.36 --- openacs-4/packages/xowf/lib/inclass-exam.wf 14 Jun 2020 20:26:29 -0000 1.1.2.35 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 17 Jun 2020 21:59:50 -0000 1.1.2.36 @@ -114,10 +114,21 @@ :unpublish_link $obj } +######################################################################## +# When the user restarts an exam, make sure, that already scheduled +# atjobs are removed. +# +restart proc activate {obj} { + xowf::test_item::answer_manager delete_scheduled_atjobs $obj +} + +######################################################################## +# When the user opens the submission review, offer a link. +# open_submission_review proc activate {obj} { set aLink [$obj pretty_link -query m=view-my-exam] - util_user_message -html \ - -message "[$obj name] exam review is available as [ns_quotehtml $aLink]" + $obj util_user_message -html -message \ + "[$obj name] exam review is available as [ns_quotehtml $aLink]"$msg } ######################################################################## @@ -126,7 +137,7 @@ # Action instproc publish_link {obj} { set aLink [$obj pretty_link -query m=answer] - util_user_message -html \ + $obj util_user_message -html \ -message "[$obj name] is available as [ns_quotehtml $aLink]" # TODO: make it happen in the LMS } @@ -135,7 +146,7 @@ # group # Action instproc unpublish_link {obj} { - util_user_message -html -message "[$obj name] is closed" + $obj util_user_message -html -message "[$obj name] is closed" # TODO: make it happen in the LMS } @@ -159,6 +170,7 @@ set synchronized [$obj property synchronized 0] set allow_paste [$obj property allow_paste 1] set max_items [$obj property max_items ""] + set time_window [$obj property time_window ""] append text [subst {

[expr {$synchronized ? "" : "Non-"}]Synchronized Exam @@ -186,6 +198,18 @@ set max_items_msg [_ xowf.Max_items_ok [list n $max_items]] } } + + set time_window_msg "" + if {$time_window ne ""} { + set dtstart [dict get $time_window time_window.dtstart] + if {$dtstart ne ""} { + regsub -all T $dtstart " " dtstart + set dtend [dict get $time_window time_window.dtend] + set time_window_msg
[_ xowf.Automatically_published_from_to [list from $dtstart to $dtend]] + set time_window_msg "
Automatische Freischaltung der Prüfung von $dtstart bis $dtend" + } + } + append text [subst {

[expr {$max_items_msg ne "" ? "$max_items_msg" : ""}] @@ -194,6 +218,7 @@ [expr {$autograde ? "#xowf.exam_review_possible#" : "#xowf.exam_review_not_possible#"}]
[expr {$randomizationOk ? "#xowf.randomization_for_exam_ok#" : "#xowf.randomization_for_exam_not_ok#"}]
[expr {$allow_paste ? "#xowf.Cut_and_paste_allowed#" : "#xowf.Cut_and_paste_not_allowed#"}]
+ $time_window_msg [expr {[llength $published_periods] > 0 ? "
#xowf.inclass-exam-open#: [join $published_periods {, }]
" : ""}] [expr {[llength $review_periods] > 0 ? "#xowf.inclass-exam-review#: [join $review_periods {, }]
" : ""}]

@@ -259,7 +284,7 @@ "published" { # # In inclass cases, never show all questions on screen, since - # the teacher might have the screen on the projector. + # the lecturer might have the screen on the projector. # template::add_script -src urn:ad:js:bootstrap3 set fullQuestionForm [subst { @@ -737,7 +762,7 @@ # state different to "published". # if {[:property _state] ne "published"} { - util_user_message -html -message "Cannot start answer workflow in this state" + $obj util_user_message -html -message "Cannot start answer workflow in this state" } else { set wf [xowf::test_item::answer_manager get_answer_wf [self]] set proctoring [:property proctoring] @@ -753,7 +778,7 @@ } :proc www-proctor-answer {} { if {[:property _state] ne "published"} { - util_user_message -html -message "Cannot start answer workflow in this state" + $obj 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]