diff --git a/question/type/random/questiontype.php b/question/type/random/questiontype.php index fbb85a75578..97ea6e2ada6 100644 --- a/question/type/random/questiontype.php +++ b/question/type/random/questiontype.php @@ -151,12 +151,13 @@ class qtype_random extends question_type { public function save_question($question, $form) { $form->name = ''; - if ($form->questiontext) { - $form->questiontext = '1'; + + // In case someone set the question text to true/false in the old style, set it properly. + if ($form->questiontext['text']) { + $form->questiontext['text'] = '1'; } else { - $form->questiontext = '0'; + $form->questiontext['text'] = '0'; } - $form->questiontextformat = FORMAT_MOODLE; $form->tags = array(); // Name is not a required field for random questions, but