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 -r1.1.2.61 -r1.1.2.62 --- openacs-4/packages/xowf/lib/inclass-exam.wf 31 Mar 2021 15:21:14 -0000 1.1.2.61 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 1 Apr 2021 17:24:57 -0000 1.1.2.62 @@ -267,25 +267,30 @@ # } + set answers [xowf::test_item::answer_manager get_answers $wf] + # - # If there are answers, include the full menu. + # Per default, the entries are disabled. when there are answers, + # these will be enabled. # - set answers [xowf::test_item::answer_manager get_answers $wf] - if {[llength $answers] > 0} { + set link_disabled [expr {[llength $answers] == 0 ? "link-disabled" : ""}] + set md [subst { + listing {obj $wf m list label #xowf.online-exam-exam_instances# glyph list} + participants {obj $obj m print-participants label #xowf.Participants# glyph user} + protocol {obj $obj m print-answers label #xowf.online-exam-protocol# glyph list-alt} + results {obj $obj m print-answer-table label #xowf.online-exam-results-table# glyph th-list} + }] - set lLink "$wf_pretty_link?m=list" - set pLink1 [$obj pretty_link -query m=print-answers] - set pLink2 [$obj pretty_link -query m=print-answer-table] - set pLink3 [$obj pretty_link -query m=print-participants] + if {![acs_user::site_wide_admin_p -user_id [::xo::cc user_id]]} { + dict unset md listing + } + dict unset md results - set menu "\[" - if {[acs_user::site_wide_admin_p -user_id [::xo::cc user_id]]} { - append menu "#xowf.online-exam-exam_instances#, " - } - append menu \ - "#xowf.Participants#, " \ - "#xowf.online-exam-protocol#, " \ - "#xowf.online-exam-results-table#\]" + set menu "" + dict for {name d} $md { + set href [[dict get $d obj] pretty_link -query m=[dict get $d m]] + append menu "" \ + " [dict get $d label]\n" } } @@ -328,7 +333,8 @@ } else { set answerStatus "" set marked "" - if {$state in {published done submission_review} } { + + if {$state in {published done submission_review} || [llength $answers] > 0 } { if {$state eq "done"} { [$ctx object] setCSSDefaults set marked [xowf::test_item::answer_manager marked_results -obj $obj -wf $wf $combined_form_info] @@ -340,6 +346,7 @@ -polling=[expr {${:live_updates} && $state ni {initial created done}}] \ -manager_obj $obj \ -target_state done \ + -extra_text $menu \ -wf $wf] } @@ -359,15 +366,15 @@ append text [subst {
-
$answerStatus
+
$answerStatus
+
$qrCode
$fullQuestionForm
-
$qrCode
$countdownHTML
}] } - set footer "$menu $extraAction" + set footer " $extraAction" #-form [subst {
$text
$fullQuestionForm
$report
text/html}] set f [::xowiki::Form new \