You are here

function qformat_qti2::shuffle_things in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/question/format/qti2/format.php \qformat_qti2::shuffle_things()

returns the given array, shuffled

Parameters

array $things:

Return value

array

1 call to qformat_qti2::shuffle_things()
qformat_qti2::writequestion in includes/moodle/question/format/qti2/format.php
Creates the export text for a question

File

includes/moodle/question/format/qti2/format.php, line 893

Class

qformat_qti2

Code

function shuffle_things($things) {
  $things = swapshuffle_assoc($things);
  $oldthings = $things;
  $things = array();
  foreach ($oldthings as $key => $value) {
    $things[] = $value;

    // This loses the index key, but doesn't matter
  }
  return $things;
}