Index: openacs-4/packages/xowf/lib/online-exam.wf
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/online-exam.wf,v
diff -u -r1.6.2.21 -r1.6.2.22
--- openacs-4/packages/xowf/lib/online-exam.wf 15 Feb 2020 10:37:53 -0000 1.6.2.21
+++ openacs-4/packages/xowf/lib/online-exam.wf 21 Feb 2020 13:45:15 -0000 1.6.2.22
@@ -148,23 +148,32 @@
set pLink "."
set menu ""
} else {
+ #
+ # Always compute the testrun and answer link.
+ #
set wf_pretty_link [$wf pretty_link]
set tLink [export_vars -base $wf_pretty_link {
{m create-new} {p.return_url "[::xo::cc url]"} {p.try_out_mode 1} {title "[$obj title]"}
}]
- set lLink "$wf_pretty_link?m=list"
set aLink [$obj pretty_link -query m=answer]
- set pLink1 [$obj pretty_link -query m=print-answers]
- set pLink2 [$obj pretty_link -query m=print-answer-table]
- #util_user_message -html -message "$survey is available as $pLink"
- # [#xowf.refresh#,
- set menu "\["
- if {[acs_user::site_wide_admin_p -user_id [::xo::cc user_id]]} {
- append menu "#xowf.online-exam-exam_instances#, "
+ #
+ # If there are answers, include the full menu.
+ #
+ set answers [xowf::test_item::answer_manager get_answers $wf]
+ if {[llength $answers] > 0} {
+
+ 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 menu "\["
+ if {[acs_user::site_wide_admin_p -user_id [::xo::cc user_id]]} {
+ append menu "#xowf.online-exam-exam_instances#, "
+ }
+ append menu \
+ "#xowf.online-exam-protocol#, " \
+ "#xowf.online-exam-results-table#\]"
}
- append menu \
- "#xowf.online-exam-protocol#, " \
- "#xowf.online-exam-results-table#\]"
}
set extraAction ""
@@ -184,7 +193,7 @@
if {$state in {published done}} {
if {$state eq "done"} {
[$ctx object] setCSSDefaults
- set marked [xowf::test_item::answer_manager marked_results $wf $combined_form_info]
+ set marked [xowf::test_item::answer_manager marked_results -obj $obj -wf $wf $combined_form_info]
}
set answerStats [xowf::test_item::answer_manager answers_panel \
-heading "#xowf.online-exam-submitted_exams_heading#" \