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 -r1.7.2.235 -r1.7.2.236 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 19 Apr 2022 15:40:30 -0000 1.7.2.235 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 28 Apr 2022 12:21:46 -0000 1.7.2.236 @@ -6657,70 +6657,8 @@ # # Provide question info block. # - set href [$obj pretty_link -query m=print-answers] + set HTML [:question_overview_block $obj] - set form_objs [:question_objs $obj] - - set chunks {} - foreach form_obj $form_objs { - set chunk [lindex [:describe_form $form_obj] 0] - set structure "" - foreach att { - question_structure choice_options sub_questions - } { - if {[dict exists $chunk $att]} { - append structure [dict get $chunk $att] - break - } - } - if {[dict exists $chunk available_pool_items]} { - append structure \ - " " [dict get $chunk available_pool_items] " " #xowf.questions# \ - " " ([dict get $chunk available_pool_item_stats]) - } - if {[dict exists $chunk nrcorrect]} { - append structure " " [:pretty_ncorrect [dict get $chunk nrcorrect]] - } - if {[$obj state] in {done submission_review} - && ![dict exists $chunk available_pool_items] - } { - dict set chunk title_value [subst { - [ns_quotehtml [$form_obj title]] - }] - } else { - dict set chunk title_value [ns_quotehtml [$form_obj title]] - } - dict set chunk structure $structure - lappend chunks $chunk - } - - - append HTML [subst { -
-
#xowf.question_summary#
-
-
- - - - - - - }] - - foreach chunk $chunks { - append HTML [subst { - - - - - - - - }] - } - append HTML "
#xowf.question_structure##xowf.Minutes##xowf.Points##xowf.Shuffle#
[:dict_value $chunk title_value][:dict_value $chunk type]: [:dict_value $chunk structure][:dict_value $chunk Minutes][:dict_value $chunk Points][:pretty_shuffle [:dict_value $chunk shuffle]][:dict_value $chunk grading]
\n" - # # When we have results, we can provide statistics # @@ -6789,6 +6727,74 @@ return $HTML } + :method question_overview_block {obj} { + set href [$obj pretty_link -query m=print-answers] + + set form_objs [:question_objs $obj] + + set chunks {} + foreach form_obj $form_objs { + set chunk [lindex [:describe_form $form_obj] 0] + set structure "" + foreach att { + question_structure choice_options sub_questions + } { + if {[dict exists $chunk $att]} { + append structure [dict get $chunk $att] + break + } + } + if {[dict exists $chunk available_pool_items]} { + append structure \ + " " [dict get $chunk available_pool_items] " " #xowf.questions# \ + " " ([dict get $chunk available_pool_item_stats]) + } + if {[dict exists $chunk nrcorrect]} { + append structure " " [:pretty_ncorrect [dict get $chunk nrcorrect]] + } + if {[$obj state] in {done submission_review} + && ![dict exists $chunk available_pool_items] + } { + dict set chunk title_value [subst { + [ns_quotehtml [$form_obj title]] + }] + } else { + dict set chunk title_value [ns_quotehtml [$form_obj title]] + } + dict set chunk structure $structure + lappend chunks $chunk + } + + + append HTML [subst { +
+
#xowf.question_summary#
+
+
+ + + + + + + }] + + foreach chunk $chunks { + append HTML [subst { + + + + + + + + }] + } + append HTML "
#xowf.question_structure##xowf.Minutes##xowf.Points##xowf.Shuffle#
[:dict_value $chunk title_value][:dict_value $chunk type]: [:dict_value $chunk structure][:dict_value $chunk Minutes][:dict_value $chunk Points][:pretty_shuffle [:dict_value $chunk shuffle]][:dict_value $chunk grading]
\n" + + return $HTML + } + #---------------------------------------------------------------------- # Class: Question_manager # Method: exam_info_block