From d758f1e2eb81ac5fba2b41f5438d691812979fc5 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 22 Aug 2006 19:26:05 +0000 Subject: [PATCH] Fix an obvious typo in the roles and permissions code. --- question/type/questiontype.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 25a22f3d4c..096d6cc0b3 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -501,9 +501,12 @@ class default_questiontype { global $CFG; $isgraded = question_state_is_graded($state->last_graded); + $cm = get_coursemodule_from_instance('quiz', $cmoptions->id); + $context = get_context_instance(CONTEXT_MODULE, $cm->id); + // For editing teachers print a link to an editing popup window $editlink = ''; - if (isteacheredit($cmoptions->course)) { + if (has_capability('mod/quiz: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); @@ -526,9 +529,6 @@ class default_questiontype { $comment = stripslashes($state->comment); $commentlink = ''; - $cm = get_coursemodule_from_instance('quiz', $quiz->id); - $context = get_context_instance(CONTEXT_MODULE, $context); - if (isset($options->questioncommentlink) && has_capability('mod/quiz:grade', $context)) { $strcomment = get_string('commentorgrade', 'quiz'); $commentlink = '