From 77b2b1fa4333b782a70188badb4ef38226e51205 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 29 Mar 2007 23:12:08 +0000 Subject: [PATCH] MDL-9107 (regression from) MDL-8994 - adding random questions to a quiz was broken. Merged from MOODLE_18_STABLE. --- mod/quiz/edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/quiz/edit.php b/mod/quiz/edit.php index a170da2932..7cd6a1e22e 100644 --- a/mod/quiz/edit.php +++ b/mod/quiz/edit.php @@ -183,6 +183,7 @@ 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; @@ -192,7 +193,6 @@ 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)) { -- 2.39.5