From 75082bdd89fb26509067e26bd5d409d199693c54 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 20 Nov 2007 17:52:16 +0000 Subject: [PATCH] MDL-12286 - 'Save as new question' button ignores the setting in the 'Save in category' dropdown. Merged from MOODLE_19_STABLE. --- question/type/questiontype.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 17fd4db3fe..3ff567597d 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -285,8 +285,17 @@ class default_questiontype { error('Could not update question!'); } } else { // Question is a new one + if (isset($form->categorymoveto)){ + // Doing save as new question, and we have move rights. + list($question->category, $notused) = explode(',', $form->categorymoveto); + //don't need to test add permission of category we are moving question to. + //Only categories that we have permission to add + //a question to will get through the form cleaning code for the select box. + } else { + // Really a new question. + list($question->category, $notused) = explode(',', $form->category); + } // Set the unique code - list($question->category,$notused) = explode(',', $form->category); $question->stamp = make_unique_id_code(); $question->createdby = $USER->id; $question->modifiedby = $USER->id; -- 2.39.5