Merge branch 'MDL-10971_cloze_shuffle_fix' of git://github.com/timhunt/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 22 Sep 2014 10:39:42 +0000 (11:39 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 22 Sep 2014 10:39:42 +0000 (11:39 +0100)
question/type/multianswer/questiontype.php

index 00c412d..147ed20 100644 (file)
@@ -209,6 +209,8 @@ class qtype_multianswer extends question_type {
 
         foreach ($questiondata->options->questions as $key => $subqdata) {
             $subqdata->contextid = $questiondata->contextid;
+            $subqdata->options->shuffleanswers = !isset($questiondata->options->shuffleanswers) ||
+                    $questiondata->options->shuffleanswers;
             $question->subquestions[$key] = question_bank::make_question($subqdata);
             $question->subquestions[$key]->maxmark = $subqdata->defaultmark;
             if (isset($subqdata->options->layout)) {