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.23 -r1.1.2.24 --- openacs-4/packages/xowf/lib/inclass-exam.wf 22 Apr 2020 19:56:26 -0000 1.1.2.23 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 25 Apr 2020 21:35:12 -0000 1.1.2.24 @@ -42,6 +42,7 @@ # - "poll" (for teachers), # - "print-answers" (for teachers), # - "print-answer-table" (for teachers), +# - "print-participants" (for teachers), # - "delete" (for teachers), # - "qrcode" (for teachers) # @@ -214,12 +215,14 @@ 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] 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#\]" } @@ -351,7 +354,6 @@ # :proc www-print-answer-table {} { set HTML "" - set ctx [::xowf::Context require [self]] set wf [xowf::test_item::answer_manager get_answer_wf [self]] if {$wf ne ""} { #set form_info [::xowf::test_item::question_manager combined_question_form -with_numbers [self]] @@ -382,6 +384,41 @@ } ######################################################################## + # web-callable method "print-participants" + # + # Print participants in a tabular form. + # + :proc www-print-participants {} { + set HTML "" + set wf [xowf::test_item::answer_manager get_answer_wf [self]] + if {$wf ne ""} { + + set items [xowf::test_item::answer_manager get_wf_instances $wf] + set items2 [$items deep_copy] + foreach i [$items2 children] { + $i set online-exam-userName [acs_user::get_element -user_id [$i creation_user] -element username] + $i set online-exam-fullName [::xo::get_user_name [$i creation_user]] + } + set HTML [::xowf::test_item::answer_manager participants_table \ + -package_id ${:package_id} \ + -items $items2 \ + -state * \ + [self]] + $items2 destroy + } + if {$HTML eq ""} { + set HTML "#xowiki.no_data#" + } else { + set HTML "

#xowf.Participants#

$HTML" + } + set return_url [[$wf package_id] query_parameter local_return_url:localurl [:pretty_link]] + append HTML "

#xowiki.back#

\n" + + :www-view $HTML + + } + + ######################################################################## # web-callable method "view-my-exam " # # Provide feedback to the student about the results.