From 522b89d1aa06f70657e4c29edde0b09075d7dc7f Mon Sep 17 00:00:00 2001
From: jamiesensei <jamiesensei>
Date: Tue, 28 Aug 2007 03:36:17 +0000
Subject: [PATCH] allow selection of category in any context when adding a
 question in question_form

---
 question/type/edit_question_form.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php
index e105bb1679..8727f86d3c 100644
--- a/question/type/edit_question_form.php
+++ b/question/type/edit_question_form.php
@@ -70,7 +70,7 @@ class question_edit_form extends moodleform {
         if (!isset($this->question->id)){
             //adding question
             $mform->addElement('questioncategory', 'category', get_string('category', 'quiz'),
-                    array('contexts' => array($this->categorycontext)));
+                    array('contexts' => $this->contexts->having_cap('moodle/question:add')));
         } elseif (!($this->question->formoptions->canmove || $this->question->formoptions->cansaveasnew)){
             //editing question with no permission to move from category.
             $mform->addElement('questioncategory', 'category', get_string('category', 'quiz'),
-- 
2.39.5