Index: openacs-4/packages/xowf/lib/online-exam-answer.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/online-exam-answer.wf,v diff -u -r1.2.2.8 -r1.2.2.9 --- openacs-4/packages/xowf/lib/online-exam-answer.wf 4 Nov 2019 10:24:39 -0000 1.2.2.8 +++ openacs-4/packages/xowf/lib/online-exam-answer.wf 6 Nov 2019 18:49:21 -0000 1.2.2.9 @@ -140,14 +140,18 @@ Action review \ -next_state done \ - -label #xowf.online-exam-review# + -label #xowf.online-exam-review# \ + -proc activate {obj} { + [[$obj wf_context ] wf_container] addSignature $obj + } Action save \ -label #xowf.online-exam-save# Action logout \ -label #xowf.online-exam-submit# \ -proc activate {obj} { + [[$obj wf_context ] wf_container] addSignature $obj set pid [$obj package_id] set try_out_mode [$obj property try_out_mode 0] set return_url [$obj property return_url .] @@ -217,14 +221,13 @@ ######################################################################## # -# Helper methods for the workflow context +# Helper methods for the workflow container # ######################################################################## # # Field-renaming form loader # - proc get_question_form_object {ctx form_name} { set obj [$ctx object] @@ -248,7 +251,6 @@ return $form_obj } - # # Set "title" with question and user information. # @@ -264,7 +266,7 @@ lappend title $titleString } lappend title \ - "[$obj title]" \ + [$obj title] \ "IP: [$obj property ip]" #ns_log notice "SETTING $obj title [join $title { · }] (Container)" $obj title [join $title " · "] @@ -331,14 +333,25 @@ -form_constraints [lsort -unique $fc]] } +:proc addSignature {obj} { + set answerAttributes [xowf::test_item::renaming_form_loader \ + answer_attributes [$obj instance_attributes]] + set sha256 [ns_md string -digest sha256 $answerAttributes] + $obj set_property -new true signature $sha256 + return $sha256 +} + + ######################################################################## # # Object specific operations # ######################################################################## :object-specific { - # ensure default value is updated for each instance individually + # + # Ensure default value is updated for each instance individually. + # Property ip -default [expr {[ns_conn isconnected] ? [ad_conn peeraddr] : "nowhere"}] set ctx [:wf_context]