From: tjhunt Date: Mon, 2 Oct 2006 17:04:12 +0000 (+0000) Subject: MDL-6761 Edit qestion link gone from question preview popup. It was checking the... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ec6adca0f43cbbc798d88676e229a3b4cb7c0821;p=moodle.git MDL-6761 Edit qestion link gone from question preview popup. It was checking the wrong capability. --- diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 77a166ab7a..1cb9e0f15e 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -523,13 +523,15 @@ class default_questiontype { $cm = get_coursemodule_from_instance('quiz', $cmoptions->id); if (!empty($cm->id)) { $context = get_context_instance(CONTEXT_MODULE, $cm->id); + } else if (!empty($cm->course)) { + $context = get_context_instance(CONTEXT_COURSE, $cm->course); } else { - $context = false; + $context = get_context_instance(CONTEXT_SYSTEM, SITEID); } // For editing teachers print a link to an editing popup window $editlink = ''; - if ($context && has_capability('mod/quiz:manage', $context)) { + if ($context && has_capability('moodle/question:manage', $context)) { $stredit = get_string('edit'); $linktext = ''.$stredit.''; $editlink = link_to_popup_window('/question/question.php?id='.$question->id, $stredit, $linktext, 450, 550, $stredit, '', true);