xowf::test_item::Question_manager method shuffled_index (public)

 <instance of xowf::test_item::Question_manager[i]> shuffled_index \
    [ -shuffle_id shuffle_id ] obj position

Defined in packages/xowf/tcl/test-item-procs.tcl

Return the shuffled index position, in case shuffling is turned on.

Switches:
-shuffle_id
(defaults to "-1") (optional)
Parameters:
obj
position

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_test_items create_test_items (test xowf) xowf::test_item::Question_manager instproc shuffled_index xowf::test_item::Question_manager instproc shuffled_index test_create_test_items->xowf::test_item::Question_manager instproc shuffled_index xowiki::randomized_indices xowiki::randomized_indices (public) xowf::test_item::Question_manager instproc shuffled_index->xowiki::randomized_indices

Testcases:
create_test_items
Source code:
if {$shuffle_id > -1} {
  #
  # Take always all questions as the basis for randomization,
  # also when "max_items" is set.
  #
  set shuffled [::xowiki::randomized_indices  -seed $shuffle_id  [:question_count -all $obj]]
  set position [lindex $shuffled $position]
  #ns_log notice "shuffled_index question_count [:question_count $obj] -> <$shuffled> -> position $position"
}
return $position
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: