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.150 -r1.7.2.151 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 14 Jul 2021 17:36:16 -0000 1.7.2.150 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 15 Jul 2021 13:17:49 -0000 1.7.2.151 @@ -131,6 +131,12 @@ return "" } + TestItemField instproc twocol_layout {} { + return [expr {[${:parent_field} get_named_sub_component_value -default 0 twocol] + ? "col-sm-6" : ""}] + } + + ########################################################### # # ::xowiki::formfield::test_item_name @@ -313,6 +319,7 @@ {points number,form_item_wrapper_CSSclass=form-inline,min=0.0,step=0.1,label=#xowf.Points#} $shuffleSpec $gradingSpec + {twocol boolean_checkbox,horizontal=true,label=#xowf.Twocol_layout#,default=f,form_item_wrapper_CSSclass=form-inline} $typeSpecificComponentSpec {interaction {$interaction_class,$options,feedback_level=${:feedback_level},auto_correct=${:auto_correct},label=}} [:feed_back_definition] @@ -562,11 +569,12 @@ dict set fc_dict correct_when [:comp_correct_when_from_value [:get_named_sub_component_value correct_when]] } + set twocol [:twocol_layout] append form \ "
\n" \ - "
\n" \ - "
$intro_text
\n" \ - "@answer@\n" \ + "
\n" \ + "
$intro_text
\n" \ + "
@answer@
\n" \ "
\n" \ "\n" append fc \ @@ -624,11 +632,10 @@ append intro_text [:text_attachments] set answerFields [:get_named_sub_component_value -from_repeat answer] if {[acs_user::site_wide_admin_p]} { - set substvalues [:get_named_sub_component_value substvalues] + set substvalues [:get_named_sub_component_value substvalues] } else { set substvalues "" } - set options {} set render_hints {} set answer {} @@ -655,11 +662,12 @@ dict set fc_dict descriptions $solution dict set fc_dict render_hints $render_hints + set twocol [:twocol_layout] append form \ "
\n" \ - "
\n" \ - "
$intro_text
\n" \ - "@answer@" \n \ + "
\n" \ + "
$intro_text
\n" \ + "
@answer@
\n" \ "
\n" \ "\n" @@ -782,11 +790,12 @@ dict set fc_dict answer $answer dict set fc_dict grading [${:parent_field} get_named_sub_component_value grading] + set twocol [:twocol_layout] append form \ "
\n" \ - "
\n" \ - "
$intro_text
\n" \ - "@answer@" \n \ + "
\n" \ + "
$intro_text
\n" \ + "
@answer@
\n" \ "
\n" \ "\n" @@ -866,11 +875,12 @@ dict set fc_dict show_max [${:parent_field} get_named_sub_component_value show_max] set interaction_class [expr {${:multiple} ? "mc_interaction" : "sc_interaction"}] + set twocol [:twocol_layout] append form \ "
\n" \ - "
\n" \ - "
$intro_text
\n" \ - "@answer@" \n \ + "
\n" \ + "
$intro_text
\n" \ + "
@answer@
\n" \ "
" \n \ "\n" @@ -954,11 +964,12 @@ } append intro_text [:text_attachments] + set twocol [:twocol_layout] append form \ "
\n" \ - "
\n" \ - "
$intro_text
\n" \ - "@answer@" \ + "
\n" \ + "
$intro_text
\n" \ + "
@answer@
\n" \ "
\n" \ "\n" append fc \