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.1 -r1.2 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 28 Aug 2014 08:24:56 -0000 1.1 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 27 Oct 2014 16:42:03 -0000 1.2 @@ -79,13 +79,13 @@ # switch -- [my question_type] { mc { # we should support as well: minChoices, maxChoices, shuffle - set interaction_class mc_interaction - set options nr_choices=[my nr_choices] - } + set interaction_class mc_interaction + set options nr_choices=[my nr_choices] + } sc { # we should support as well: minChoices, maxChoices, shuffle - set interaction_class mc_interaction - set options nr_choices=[my nr_choices],multiple=false - } + set interaction_class mc_interaction + set options nr_choices=[my nr_choices],multiple=false + } ot { set interaction_class text_interaction } default {error "unknown question type: [my question_type]"} } @@ -191,7 +191,7 @@ append form "
$intro_text
\n" #my msg " input_field_names=[my set input_field_names]" - + if {![my multiple]} { set correct_field_name [my get_named_sub_component_value correct] } @@ -271,8 +271,8 @@ } if {[my feedback_level] eq "full"} { set feedback_fields { - {feedback_correct {textarea,cols=60,label=#xowf.feedback_correct#}} - {feedback_incorrect {textarea,cols=60,label=#xowf.feedback_incorrect#}} + {feedback_correct {textarea,cols=60,label=#xowf.feedback_correct#}} + {feedback_incorrect {textarea,cols=60,label=#xowf.feedback_incorrect#}} } } else { set feedback_fields "" @@ -403,17 +403,17 @@ set alt_inputs [list] set alt_values [list] foreach html_type {input textarea} { - foreach n [$root selectNodes "//$html_type\[@name != ''\]"] { - set alt_input [$n getAttribute name] - $n setAttribute name $prefix-$alt_input - if {$html_type eq "input"} { - set alt_value [$n getAttribute value] - } else { - set alt_value "" - } - lappend alt_inputs $alt_input - lappend alt_values $alt_value - } + foreach n [$root selectNodes "//$html_type\[@name != ''\]"] { + set alt_input [$n getAttribute name] + $n setAttribute name $prefix-$alt_input + if {$html_type eq "input"} { + set alt_value [$n getAttribute value] + } else { + set alt_value "" + } + lappend alt_inputs $alt_input + lappend alt_values $alt_value + } } # We have to drop the toplevel
of the included form foreach n [$root childNodes] {append form [$n asHTML]} @@ -423,17 +423,17 @@ # foreach f [dict get $__ia form_constraints] { if {[regexp {^([^:]+):(.*)$} $f _ field_name definition]} { - if {[string match @* $field_name]} continue + if {[string match @* $field_name]} continue # keep all form-constraints for which we have altered the name - #my msg "old fc=$f, [list lsearch -exact $alt_inputs $field_name] => [lsearch -exact $alt_inputs $field_name] $alt_values" - set ff [[my object] create_raw_form_field -name $field_name -spec $definition] - #my msg "ff answer => '[$ff answer]'" + #my msg "old fc=$f, [list lsearch -exact $alt_inputs $field_name] => [lsearch -exact $alt_inputs $field_name] $alt_values" + set ff [[my object] create_raw_form_field -name $field_name -spec $definition] + #my msg "ff answer => '[$ff answer]'" if {$field_name in $alt_inputs} { - lappend fc $prefix-$f - } elseif {[$ff exists answer] && $field_name eq [$ff answer]} { - # this rules is for single choice - lappend fc $prefix-$f - } + lappend fc $prefix-$f + } elseif {[$ff exists answer] && $field_name eq [$ff answer]} { + # this rules is for single choice + lappend fc $prefix-$f + } } } } @@ -449,3 +449,10 @@ #my msg "fc=$fc" } } + +# +# Local variables: +# mode: tcl +# tcl-indent-level: 2 +# indent-tabs-mode: nil +# End: