You are here

public function MatchingQuestion::customShuffle in Quiz 6.6

Same name and namespace in other branches
  1. 6.3 question_types/matching/matching.classes.inc \MatchingQuestion::customShuffle()
  2. 6.4 question_types/matching/matching.classes.inc \MatchingQuestion::customShuffle()
  3. 6.5 question_types/matching/matching.classes.inc \MatchingQuestion::customShuffle()
  4. 7.6 question_types/matching/matching.classes.inc \MatchingQuestion::customShuffle()
  5. 7 question_types/matching/matching.classes.inc \MatchingQuestion::customShuffle()
  6. 7.4 question_types/matching/matching.classes.inc \MatchingQuestion::customShuffle()
  7. 7.5 question_types/matching/matching.classes.inc \MatchingQuestion::customShuffle()
1 call to MatchingQuestion::customShuffle()
MatchingQuestion::getQuestionForm in question_types/matching/matching.classes.inc
Get the form that will be displayed to the test-taking user.

File

question_types/matching/matching.classes.inc, line 105
matching.classes

Class

MatchingQuestion
Implementation of Matching.

Code

public function customShuffle($array = array()) {
  $new_array = array();
  while (count($array)) {
    $element = array_rand($array);
    $new_array[$element] = $array[$element];
    unset($array[$element]);
  }
  return $new_array;
}