You are here

function _cloze_shuffle_choices in Cloze 6

Same name and namespace in other branches
  1. 7 cloze.module \_cloze_shuffle_choices()
1 call to _cloze_shuffle_choices()
ClozeQuestion::getAnsweringForm in ./cloze.classes.inc
Implementation of getAnsweringForm

File

./cloze.module, line 83

Code

function _cloze_shuffle_choices($choices) {
  $new_array = array();
  $new_array[''] = '';
  while (count($choices)) {
    $element = array_rand($choices);
    $new_array[$element] = $choices[$element];
    unset($choices[$element]);
  }
  return $new_array;
}