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.73 -r1.7.2.74 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 13 Aug 2020 12:00:02 -0000 1.7.2.73 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 13 Aug 2020 14:41:51 -0000 1.7.2.74 @@ -279,7 +279,7 @@ mc_interaction instproc convert_to_internal {} { # # Build a form from the components of the exercise on the fly. - # Actually, this methods computes the properties "form" and + # Actually, this method computes the properties "form" and # "form_constraints" based on the components of this form field. # set form "
\n\n" @@ -338,14 +338,21 @@ # build form constraints per input field # set if_fc [list] - if {[string is true -strict $correct]} {lappend if_fc "answer=$input_field_name"} else {lappend if_fc "answer="} + #lappend answer_set [string is true -strict $correct] + if {[string is true -strict $correct]} { + lappend if_fc "answer=t" "options={{} $input_field_name}" + } else { + lappend if_fc "answer=f" + } if {$value(feedback_correct) ne ""} { lappend if_fc "feedback_answer_correct=[::xowiki::formfield::FormField fc_encode $value(feedback_correct)]" } if {$value(feedback_incorrect) ne ""} { lappend if_fc "feedback_answer_incorrect=[::xowiki::formfield:::FormField fc_encode $value(feedback_incorrect)]" } - if {[llength $if_fc] > 0} {append fc [list $input_field_name:checkbox,[join $if_fc ,]]\n} + if {[llength $if_fc] > 0} { + append fc [list $input_field_name:checkbox,[join $if_fc ,]] \n + } #:msg "$input_field_name .correct = $value(correct)" } @@ -354,8 +361,7 @@ lappend fc "radio:text,answer=$correct_field_value" } append form "
\n" - #ns_log notice FORM=$form - #ns_log notice FC=$fc + ns_log notice FORM=$form\nFC=$fc ${:object} set_property -new 1 form $form ${:object} set_property -new 1 form_constraints $fc set anon_instances true ;# TODO make me configurable @@ -929,7 +935,7 @@ 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 + # this rule is for single choice lappend fc $prefix-$f } }