The _decisions_randomize_options() function no longer works on PHP versions >= 5.2.10, due to an API change in PHP. See http://ca2.php.net/array_rand:

5.2.10	 The resulting array of keys is no longer shuffled.

With a higher PHP version:

  // Put array keys from ordered choices in random order.
  $rand_keys = array_rand($choices, $num_choices);
  dsm($rand_keys);

...$rand_keys will have the keys in the exact order as the original array.

Please DO NOT commit a fix for this issue without also committing the fix at #1589306: Random order ranking poll produces completely invalid poll results or you will cause voting results to be completely invalid!

Comments

cafuego’s picture

This issue is addressed in the patch on comment #2 on #1589306: Random order ranking poll produces completely invalid poll results.

webchick’s picture

Status: Active » Closed (duplicate)