]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9107 (regression from) MDL-8994 - adding random questions to a quiz was broken...
authortjhunt <tjhunt>
Thu, 29 Mar 2007 23:12:08 +0000 (23:12 +0000)
committertjhunt <tjhunt>
Thu, 29 Mar 2007 23:12:08 +0000 (23:12 +0000)
mod/quiz/edit.php

index a170da293232cc818b8e4b716d708b70df56dc5b..7cd6a1e22e7959546e9e987ce0210e58d41e1a0a 100644 (file)
         if ($randomcreate > 0) {
 
             $form->name = get_string('random', 'quiz') .' ('. $category->name .')';
+            $form->category = $category->id;
             $form->questiontext = $recurse; // we use the questiontext field to store the info
                                             // on whether to include questions in subcategories
             $form->questiontextformat = 0;
             for ($i=0; $i<$randomcreate; $i++) {
                 $form->stamp = make_unique_id_code();  // Set the unique code (not to be changed)
                 $question = new stdClass;
-                $question->category = $category->id;
                 $question->qtype = RANDOM;
                 $question = $QTYPES[RANDOM]->save_question($question, $form, $course);
                 if(!isset($question->id)) {