Quiz development: Random Questions/Answers

Re: Quiz development: Random Questions/Answers

by Petronel Postolache -
Number of replies: 0

I found something very easy that satisfy my needs. Shuffle the order of displaying answers.

I just changed mod/quiz/lib.php line 487 to:

$answerids = explode(",", $options->answers);
//shuffle answers order
srand ((float)microtime()*1000000);
shuffle ($answerids);

foreach ($answerids as $key => $answerid) {

To shuffle the order of questions just add:

shuffle ($questions);

after
$questions = explode(",", $quiz->questions);