diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php index c1eff4c719c..2b3ec618e86 100644 --- a/question/type/edit_question_form.php +++ b/question/type/edit_question_form.php @@ -146,12 +146,17 @@ abstract class question_edit_form extends question_wizard_form { // Editing question with no permission to move from category. $mform->addElement('questioncategory', 'category', get_string('category', 'question'), array('contexts' => array($this->categorycontext))); + $mform->addElement('hidden', 'usecurrentcat', 1); + $mform->setType('usecurrentcat', PARAM_BOOL); + $mform->setConstant('usecurrentcat', 1); } else if ($this->question->formoptions->movecontext) { // Moving question to another context. $mform->addElement('questioncategory', 'categorymoveto', get_string('category', 'question'), array('contexts' => $this->contexts->having_cap('moodle/question:add'))); - + $mform->addElement('hidden', 'usecurrentcat', 1); + $mform->setType('usecurrentcat', PARAM_BOOL); + $mform->setConstant('usecurrentcat', 1); } else { // Editing question with permission to move from category or save as new q. $currentgrp = array();