Index: openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml,v diff -u -N -r1.2.2.48 -r1.2.2.49 --- openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 23 Apr 2021 17:56:16 -0000 1.2.2.48 +++ openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 24 Apr 2021 19:31:34 -0000 1.2.2.49 @@ -214,4 +214,8 @@ Frage markieren Makierung l�schen + Zusammenfassung + Fragen�bersicht + Detail�bersicht + Index: openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml,v diff -u -N -r1.2.2.48 -r1.2.2.49 --- openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 23 Apr 2021 17:56:16 -0000 1.2.2.48 +++ openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 24 Apr 2021 19:31:34 -0000 1.2.2.49 @@ -231,5 +231,9 @@ Preview Flag this Question - Remove Flag + Remove Flag + + Summary + Questions + Detailed summary Index: openacs-4/packages/xowf/lib/answer-single-question.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/Attic/answer-single-question.wf,v diff -u -N -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/xowf/lib/answer-single-question.wf 23 Nov 2020 19:45:01 -0000 1.1.2.2 +++ openacs-4/packages/xowf/lib/answer-single-question.wf 24 Apr 2021 19:31:34 -0000 1.1.2.3 @@ -94,28 +94,8 @@ # set form_obj ::[$obj parent_id] - set question_infos [::xowf::test_item::question_manager describe_form $form_obj] - foreach question_info $question_infos { - if {$question_info ne ""} { - # - # The handled metrics are currently hardcoded here. So, we can - # rely on having the returned value in the message keys. The - # list order is important, since it determines also the ordering - # in the message. - # - foreach metric { choice_options sub_questions nrcorrect shuffle } { - if {[dict exists $question_info $metric]} { - set m [dict get $question_info $metric] - switch $metric { - nrcorrect { append msg " (#xowf.Correct# $m) " } - shuffle { append msg "#xowf.Shuffle#: #xowf.shuffle_$m# " } - default { append msg "#xowf.$metric#: $m "} - } - } - } - #append msg "
$question_info
" - util_user_message -html -message $msg - } + foreach chunk [::xowf::test_item::question_manager describe_form -asHTML $form_obj] { + util_user_message -html -message $chunk } return $form_obj } Index: openacs-4/packages/xowf/lib/edit-interaction.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/Attic/edit-interaction.wf,v diff -u -N -r1.1.2.10 -r1.1.2.11 --- openacs-4/packages/xowf/lib/edit-interaction.wf 23 Apr 2021 17:56:16 -0000 1.1.2.10 +++ openacs-4/packages/xowf/lib/edit-interaction.wf 24 Apr 2021 19:31:34 -0000 1.1.2.11 @@ -22,11 +22,11 @@ } Action save -next_state created -label #xowiki.Form-submit_button# -Action tryout -next_state created -label #xowf.Preview# -proc activate {obj} { +Action preview -next_state created -label #xowf.Preview# -proc activate {obj} { # - # The action tryout renders the current test-item (question, + # The action preview renders the current test-item (question, # exercise, ...) the same was as it is shown in an quiz/exam. The - # tryout action uses the workflow "en:answer-single-question.wf" for + # preview action uses the workflow "en:answer-single-question.wf" for # rendering it. The instance for filling out the question is created # as a child object of the test-item. # @@ -69,11 +69,11 @@ ad_script_abort } -State initial -actions {save tryout} +State initial -actions {save preview} State created \ - -actions {save tryout} \ + -actions {save preview} \ -in_role swa { - -actions {save view tryout} + -actions {save view preview} } :proc item_type {obj} { @@ -95,8 +95,8 @@ set form_name [${container} form_name_from_item_type [self]] ${container}::initial form $form_name ${container}::created form $form_name - ${container}::created actions {save tryout} - #${container}::created in_role swa { -actions {save view tryout} } + ${container}::created actions {save preview} + #${container}::created in_role swa { -actions {save view preview} } } # 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.65 -r1.1.2.66 --- openacs-4/packages/xowf/lib/inclass-exam.wf 23 Apr 2021 21:26:13 -0000 1.1.2.65 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 24 Apr 2021 19:31:34 -0000 1.1.2.66 @@ -50,6 +50,7 @@ # - "print-answers" (for lecturers), # - "print-answer-table" (for lecturers), # - "print-participants" (for lecturers), +# - "exam-summary" (for lecturers), # - "delete" (for lecturers), # - "qrcode" (for lecturers) # @@ -169,6 +170,7 @@ :proc load_form {ctx title} { set obj [$ctx object] set state [$obj property _state] + set proctoring [$obj property proctoring 0] set combined_form_info [::xowf::test_item::question_manager combined_question_form -with_numbers $obj] set fullQuestionForm [dict get $combined_form_info form] @@ -177,72 +179,18 @@ #:log fullQuestionForm=$fullQuestionForm set text "

$title

" set menu "" - set proctoring [$obj property proctoring 0] - set synchronized [$obj property synchronized 0] - set allow_paste [$obj property allow_paste 1] - set max_items [$obj property max_items ""] - set time_window [$obj property time_window ""] - append text [subst {

- [expr {$synchronized ? "" : "Non-"}]Synchronized Exam - [expr {$proctoring ? " with Proctoring" : ""}] -

}] - set question_objs [dict get $combined_form_info question_objs] - set nrQuestions [llength $question_objs] - set randomizationOk [dict get $combined_form_info randomization_for_exam] - set autograde [dict get $combined_form_info autograde] - set revision_sets [$obj get_revision_sets] - set published_periods [xowf::test_item::answer_manager state_periods $revision_sets -state published] - set review_periods [xowf::test_item::answer_manager state_periods $revision_sets -state submission_review] - set total_minutes [xowf::test_item::question_manager total_minutes -max_items $max_items $combined_form_info] - set total_points [xowf::test_item::question_manager total_points -max_items $max_items $combined_form_info] - set max_items_msg "" + set text [::xowf::test_item::question_manager exam_info_block \ + -combined_form_info $combined_form_info \ + $obj] + set detail_link [$obj pretty_link -query m=exam-summary] + append text "

#xowf.detailed_summary#

" - if {$max_items ne ""} { - set all_minutes [lmap t [dict get $combined_form_info title_infos] { - dict get $t minutes - }] - if {[llength [lsort -unique $all_minutes]] != 1} { - set max_items_msg [_ xowf.Max_items_not_ok_duration [list n $max_items]] - } elseif {$max_items > [llength $all_minutes]} { - set max_items_msg [_ xowf.Max_items_not_ok_number [list n $max_items]] - } else { - set max_items_msg [_ xowf.Max_items_ok [list n $max_items]] - } - } - - set time_window_msg "" - if {$time_window ne ""} { - set dtstart [dict get $time_window time_window.dtstart] - if {$dtstart ne ""} { - regsub -all T $dtstart " " dtstart - set dtend [dict get $time_window time_window.dtend] - set time_window_msg
[_ xowf.Automatically_published_from_to [list from $dtstart to $dtend]] - set time_window_msg "
Automatische Freischaltung der Prüfung von $dtstart bis $dtend" - } - } - - append text [subst { -

- [expr {$max_items_msg ne "" ? "$max_items_msg" : ""}] - $nrQuestions [expr {$nrQuestions == 1 ? "#xowf.question#" : "#xowf.questions#"}], - $total_minutes #xowf.Minutes#, $total_points #xowf.Points#
- [expr {$autograde ? "#xowf.exam_review_possible#" : "#xowf.exam_review_not_possible#"}]
- [expr {$randomizationOk ? "#xowf.randomization_for_exam_ok#" : "#xowf.randomization_for_exam_not_ok#"}]
- [expr {$allow_paste ? "#xowf.Cut_and_paste_allowed#" : "#xowf.Cut_and_paste_not_allowed#"}]
- $time_window_msg - [expr {[llength $published_periods] > 0 ? "
#xowf.inclass-exam-open#: [join $published_periods {, }]
" : ""}] - [expr {[llength $review_periods] > 0 ? "#xowf.inclass-exam-review#: [join $review_periods {, }]
" : ""}] -

- }] - set wf [xowf::test_item::answer_manager get_answer_wf $obj] if {$wf eq ""} { :msg "cannot get current workflow for [$obj name]" - set lLink "." set tLink "." set aLink "." - set pLink "." } else { # # Always compute the test-run and answer link. @@ -270,7 +218,7 @@ set answers [xowf::test_item::answer_manager get_answers $wf] # - # Per default, the entries are disabled. when there are answers, + # Per default, the entries are disabled. When there are answers, # these will be enabled. # set link_disabled [expr {[llength $answers] == 0 ? "link-disabled" : ""}] @@ -531,6 +479,15 @@ } ######################################################################## + # web-callable method "exam-summary" + # + # Print a summary of the exam-questions. + # + :proc www-exam-summary {} { + :www-view [::xowf::test_item::question_manager exam_summary [self]] + } + + ######################################################################## # web-callable method "print-answers" # # Print the answers in a somewhat printer friendly way. @@ -566,7 +523,7 @@ set grading_scheme ::xowf::test_item::grading::wi1 } #ns_log notice "USE grading_scheme $grading_scheme" - + set grade_dict {} set grade_csv "" @@ -850,7 +807,7 @@ } set return_url [:query_parameter local_return_url:localurl [:pretty_link]] - append HTML "

#xowiki.back#

\n" + append HTML "

#xowiki.back#

\n" } #::xo::cc set_parameter template_file view-plain-master #::xo::cc set_parameter MenuBar 0 Index: openacs-4/packages/xowf/tcl/test-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/test-item-procs.tcl,v diff -u -N -r1.7.2.123 -r1.7.2.124 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 23 Apr 2021 21:26:13 -0000 1.7.2.123 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 24 Apr 2021 19:31:34 -0000 1.7.2.124 @@ -2810,6 +2810,9 @@ # - total_minutes_for_exam # - exam_target_time # + # - describe_form + # - exam_summary + # :public method goto_page {obj:object position} { # # Set the position (test item number) of the workflow @@ -3410,7 +3413,7 @@ $form_objs] } - :public method describe_form {form_obj} { + :public method describe_form {{-asHTML:switch} form_obj} { # # Call for every form field of the form_obj the "describe" # method and return these infos in a form of a list. @@ -3420,13 +3423,147 @@ set form_fields [$form_obj create_form_fields_from_form_constraints \ -lookup \ [lsort -unique [$form_obj property form_constraints]]] - return [lmap form_field $form_fields { + set question_infos [lmap form_field $form_fields { $form_field describe }] + + #ns_log notice "describe_form [$form_obj name]: $question_infos" + if {!$asHTML} { + return $question_infos + } + + set msgList {} + foreach question_info $question_infos { + if {$question_info ne ""} { + # + # The handled metrics are currently hardcoded here. So, we can + # rely on having the returned value in the message keys. The + # list order is important, since it determines also the ordering + # in the message. + # + set msg "" + foreach metric { choice_options sub_questions nrcorrect Minutes Points shuffle } { + if {[dict exists $question_info $metric]} { + set m [dict get $question_info $metric] + switch $metric { + nrcorrect { append msg " (#xowf.Correct# $m) " } + shuffle { append msg "#xowf.Shuffle#: #xowf.shuffle_$m# " } + default { append msg "#xowf.$metric#: $m "} + } + } + } + #append msg "
$question_info
" + lappend msgList "$msg\n" + } + } + return $msgList } + :public method exam_summary {obj} { + # + # Provide a summary of all questions of an exam. + # + set form_objs [:question_objs $obj] + set HTML [subst { +
+
#xowf.exam_summary#
+
+ [:exam_info_block $obj] +
+
+ }] + append HTML [subst { +
+
#xowf.question_summary#
+
+
+ }] + foreach form_obj $form_objs { + set chunk [:describe_form -asHTML $form_obj] + append HTML [subst { + + + + + }] + } + append HTML "
[ns_quotehtml [$form_obj title]][join $chunk { }]
\n" + set return_url [::xo::cc query_parameter local_return_url:localurl [$obj pretty_link]] + append HTML "

#xowiki.back#

\n" + + return $HTML + } + + :public method exam_info_block {-combined_form_info obj} { + # + # Provide a summarive overview of an exam. + # + if {![info exists combined_form_info]} { + set combined_form_info [:combined_question_form -with_numbers $obj] + } + set proctoring [$obj property proctoring 0] + set synchronized [$obj property synchronized 0] + set allow_paste [$obj property allow_paste 1] + set max_items [$obj property max_items ""] + set time_window [$obj property time_window ""] + + append text [subst {

+ [expr {$synchronized ? "" : "Non-"}]Synchronized Exam + [expr {$proctoring ? " with Proctoring" : ""}] +

}] + set question_objs [dict get $combined_form_info question_objs] + set nrQuestions [llength $question_objs] + set randomizationOk [dict get $combined_form_info randomization_for_exam] + set autograde [dict get $combined_form_info autograde] + set revision_sets [$obj get_revision_sets] + set published_periods [xowf::test_item::answer_manager state_periods $revision_sets -state published] + set review_periods [xowf::test_item::answer_manager state_periods $revision_sets -state submission_review] + set total_minutes [:total_minutes -max_items $max_items $combined_form_info] + set total_points [:total_points -max_items $max_items $combined_form_info] + set max_items_msg "" + + if {$max_items ne ""} { + set all_minutes [lmap t [dict get $combined_form_info title_infos] { + dict get $t minutes + }] + if {[llength [lsort -unique $all_minutes]] != 1} { + set max_items_msg [_ xowf.Max_items_not_ok_duration [list n $max_items]] + } elseif {$max_items > [llength $all_minutes]} { + set max_items_msg [_ xowf.Max_items_not_ok_number [list n $max_items]] + } else { + set max_items_msg [_ xowf.Max_items_ok [list n $max_items]] + } + } + + set time_window_msg "" + if {$time_window ne ""} { + set dtstart [dict get $time_window time_window.dtstart] + if {$dtstart ne ""} { + regsub -all T $dtstart " " dtstart + set dtend [dict get $time_window time_window.dtend] + set time_window_msg
[_ xowf.Automatically_published_from_to [list from $dtstart to $dtend]] + set time_window_msg "
Automatische Freischaltung der Prüfung von $dtstart bis $dtend" + } + } + + append text [subst { +

+ [expr {$max_items_msg ne "" ? "$max_items_msg" : ""}] + $nrQuestions [expr {$nrQuestions == 1 ? "#xowf.question#" : "#xowf.questions#"}], + $total_minutes #xowf.Minutes#, $total_points #xowf.Points#
+ [expr {$autograde ? "#xowf.exam_review_possible#" : "#xowf.exam_review_not_possible#"}]
+ [expr {$randomizationOk ? "#xowf.randomization_for_exam_ok#" : "#xowf.randomization_for_exam_not_ok#"}]
+ [expr {$allow_paste ? "#xowf.Cut_and_paste_allowed#" : "#xowf.Cut_and_paste_not_allowed#"}]
+ $time_window_msg + [expr {[llength $published_periods] > 0 ? "
#xowf.inclass-exam-open#: [join $published_periods {, }]
" : ""}] + [expr {[llength $review_periods] > 0 ? "#xowf.inclass-exam-review#: [join $review_periods {, }]
" : ""}] +

+ }] + return $text + } + :method total {-property:required title_infos} { set total 0 foreach title_info $title_infos { @@ -3594,6 +3731,16 @@ # The dict keys of the result should correspond as far as possible # to message keys to ease multi-language communication. # + set qa [${:object} property question] + foreach {key name} { + question.minutes Minutes + question.points Points + question.grading grading + } { + if {[dict exists $qa $key]} { + dict set d $name [dict get $qa $key] + } + } switch [:info class] { ::xowiki::formfield::checkbox { # mc interaction Index: openacs-4/packages/xowf/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/www/index.vuh,v diff -u -N -r1.6 -r1.6.2.1 --- openacs-4/packages/xowf/www/index.vuh 23 Jul 2018 19:42:34 -0000 1.6 +++ openacs-4/packages/xowf/www/index.vuh 24 Apr 2021 19:31:34 -0000 1.6.2.1 @@ -9,7 +9,7 @@ @cvs-id $Id$ } -parameter { - {-m view} + {-m:token view} {-folder_id:integer 0} } ::$package_id log "--starting... [ns_conn url] [ns_conn query] (user_id [xo::cc user_id])"