From b78d7c8ab08a11d6b306885e262bd1eab7e1fbe6 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 4 Nov 2009 14:07:13 +0000 Subject: [PATCH] quiz MDL-20718 notice on review page. --- mod/quiz/review.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/quiz/review.php b/mod/quiz/review.php index 3bd521dcfe0..bb24dad2d44 100644 --- a/mod/quiz/review.php +++ b/mod/quiz/review.php @@ -38,7 +38,7 @@ require_login($course->id, false, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); $coursecontext = get_context_instance(CONTEXT_COURSE, $cm->course); - $isteacher = has_capability('mod/quiz:preview', get_context_instance(CONTEXT_MODULE, $cm->id)); + $isteacher = has_capability('mod/quiz:preview', $context); $options = quiz_get_reviewoptions($quiz, $attempt, $context); $popup = $isteacher ? 0 : $quiz->popup; // Controls whether this is shown in a javascript-protected window or with a safe browser. @@ -124,7 +124,7 @@ /// Print the page header $pagequestions = explode(',', $pagelist); $headtags = get_html_head_contributions($pagequestions, $questions, $states); - if (!$ispreviewing && $quiz->popup) { + if (!$isteacher && $quiz->popup) { define('MESSAGE_WINDOW', true); // This prevents the message window coming up print_header($course->shortname.': '.format_string($quiz->name), '', '', '', $headtags, false, '', '', false, ''); if ($quiz->popup == 1) { @@ -141,7 +141,7 @@ echo ''; // for overlib /// Print heading and tabs if this is part of a preview - if (has_capability('mod/quiz:preview', $context)) { + if ($isteacher) { if ($attempt->userid == $USER->id) { // this is the report on a preview $currenttab = 'preview'; } else {