private function ChoiceQuestion::shuffle in Quiz 6.6
1 call to ChoiceQuestion::shuffle()
- ChoiceQuestion::getQuestionForm in question_types/
choice/ choice.classes.inc - Generates the question form.
File
- question_types/
choice/ choice.classes.inc, line 308 - The main classes for the choice question type.
Class
- ChoiceQuestion
- Implementation of QuizQuestion.
Code
private function shuffle(&$array) {
$newArray = array();
$toReturn = array_keys($array);
shuffle($toReturn);
foreach ($toReturn as $key) {
$newArray[$key] = $array[$key];
}
$array = $newArray;
return $toReturn;
}