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.159 -r1.7.2.160 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 7 Sep 2021 17:21:47 -0000 1.7.2.159 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 16 Sep 2021 18:16:44 -0000 1.7.2.160 @@ -148,7 +148,7 @@ "
$intro_text
\n" \ "
$body
\n" \ "\n" \ - "\n"] + "\n"] } @@ -337,14 +337,17 @@ if {${:question_type} eq "section"} { # - # Don't show "minutes" and "points" in the composite test item - # form but still define it, such we can compute and update it in - # convert_to_internal with little effort, since all "question" - # content is built based on included form fields. + # Don't show "minutes" and "points" in the full composite test + # item form but still define it, such we can compute and update + # it in convert_to_internal with little effort, since all + # "question" content is built based on included form fields. # set pointsSpec { {minutes hidden} {points hidden} + {show_minutes boolean_checkbox,form_item_wrapper_CSSclass=form-inline,default=t,label=#xowf.Composite_Show_minutes#} + {show_points boolean_checkbox,form_item_wrapper_CSSclass=form-inline,default=f,label=#xowf.Composite_Show_points#} + {show_title boolean_checkbox,form_item_wrapper_CSSclass=form-inline,default=f,label=#xowf.Composite_Show_title#} } } else { set pointsSpec { @@ -696,7 +699,7 @@ dict set fc_dict substvalues $substvalues set form [:form_markup -interaction short_text -intro_text $intro_text -body @answer@] - + set fc {} lappend fc \ answer:[:dict_to_fc -type text_fields $fc_dict] \ @@ -1060,9 +1063,23 @@ # set number 0 set numbers [lmap formObj $formObjs {incr number}] + + set option_dict {with_minutes t with_points f with_title f} + foreach field {show_minutes show_points show_title} { + set value [${:parent_field} get_named_sub_component_value -default "" $field] + if {$value ne ""} { + dict set option_dict $field $value + } + } + set title_options [lmap kind {minutes points title} { + if {![dict get $option_dict show_$kind]} { + continue + } + set result "-with_$kind" + }] set question_infos [::xowf::test_item::question_manager question_info \ -question_number_label "#xowf.subquestion#" \ - -with_minutes \ + {*}$title_options \ -numbers $numbers \ -no_position \ -obj ${:object} $formObjs]