Index: openacs-4/packages/xowf/xowf.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/xowf.info,v diff -u -N -r1.12.2.35 -r1.12.2.36 --- openacs-4/packages/xowf/xowf.info 12 Jun 2021 18:00:34 -0000 1.12.2.35 +++ openacs-4/packages/xowf/xowf.info 21 Jun 2021 07:05:55 -0000 1.12.2.36 @@ -10,15 +10,15 @@ t xowf - + Gustaf Neumann XoWiki Content Flow - an XoWiki based workflow system implementing state-based behavior of wiki pages and forms 2017-08-06 WU Vienna BSD-Style 2 - + 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.74 -r1.1.2.75 --- openacs-4/packages/xowf/lib/inclass-exam.wf 9 Jun 2021 06:39:57 -0000 1.1.2.74 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 21 Jun 2021 07:05:55 -0000 1.1.2.75 @@ -107,7 +107,17 @@ # publish user participation link. # publish proc activate {obj} { - xowf::test_item::answer_manager delete_all_answer_data $obj + # + # On the first activation of "publish", older data (e.g. from + # testruns) is removed. When the exam was already published before - + # e.g. a manual publish operation before an automatic one - NO + # cleanup is performed to avoid potential loss of submission data. + # + set revision_sets [$obj get_revision_sets] + set published_periods [xowf::test_item::answer_manager state_periods $revision_sets -state published] + if {[llength $published_periods] == 0} { + xowf::test_item::answer_manager delete_all_answer_data $obj + } :publish_link $obj } @@ -494,7 +504,7 @@ # :proc www-print-answers {} { template::head::add_link -rel stylesheet -href /resources/xowf/test-item.css - + set as_student [:query_parameter as_student:boolean false] set d [xowf::test_item::answer_manager render_answers \ -as_student $as_student \ @@ -508,12 +518,12 @@ [self]] set do_stream [dict get $d do_stream] - set HTML [dict get $d HTML] - + set HTML [dict get $d HTML] + if {$do_stream == 0 && $HTML eq ""} { set HTML "#xowiki.no_data#" } - + if {!$as_student} { set return_url [:query_parameter local_return_url:localurl [:pretty_link]] append HTML "

#xowiki.back#

\n"