Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.284.2.68 -r1.284.2.69 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 19 Jan 2020 21:07:06 -0000 1.284.2.68 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 25 Jan 2020 13:40:39 -0000 1.284.2.69 @@ -3261,24 +3261,10 @@ # then the shuffling is stable for this seed. # if {${:shuffle_kind} ne "always"} { - - #ns_log notice "===================== randomized_indices ${:shuffle_kind} [${:object} item_id]" - expr {srand([xo::cc user_id])} + set shuffled [::xowiki::randomized_indices -seed [xo::cc user_id] $length] + } else { + set shuffled [::xowiki::randomized_indices $length] } - # - # Produce shuffled indices between 0 and length-1. - # - set indices {} - for {set i 0} {$i < $length} {incr i} { - lappend indices $i - } - set shuffled {} - incr length - for {} {$length > 1} {incr length -1} { - set i [expr {int(($length-1) * rand())}] - lappend shuffled [lindex $indices $i] - set indices [lreplace $indices $i $i] - } return $shuffled }