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.169 -r1.7.2.170 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 3 Nov 2021 19:11:22 -0000 1.7.2.169 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 4 Nov 2021 17:14:00 -0000 1.7.2.170 @@ -4370,6 +4370,7 @@ {-user_answers:object,0..1 ""} {-no_position:switch false} {-question_number_label #xowf.question#} + {-positions:int,0..n ""} form_objs } { # @@ -4382,10 +4383,13 @@ set full_fc {} set full_disabled_fc {} set title_infos {} - set position 0 + if {[llength $positions] == 0} { + set position -1 + set positions [lmap form_obj $form_objs {incr position}] + } set randomizationOk 1 set autoGrade 1 - foreach form_obj $form_objs number $numbers { + foreach form_obj $form_objs number $numbers position $positions { #if {[info exists fixed_position]} { # set position $fixed_position #} @@ -4473,7 +4477,6 @@ -minutes $minutes \ -points $points \ {*}$positionArg] - incr position set formAttributes [$form_obj instance_attributes] if {[dict exists $formAttributes question]} { @@ -4636,6 +4639,14 @@ #if {$user_answers eq ""} {xo::show_stack} set all_form_objs [:question_objs -shuffle_id $shuffle_id $obj] + set positions {} + if {[llength $form_objs] > 0} { + foreach form_obj $form_objs { + lappend positions [lsearch $all_form_objs $form_obj] + } + } + #ns_log notice "XXX combined_question_form fos=$form_objs all_form_objs=$all_form_objs <$positions>" + if {$user_specific} { set max_items [$obj property max_items ""] if {$max_items ne ""} { @@ -4673,6 +4684,7 @@ {*}$extra_flags \ -obj $obj \ -user_answers $user_answers \ + -positions $positions \ $form_objs] }