Permalink
Browse files

Revert "MDL-34257 quiz 'secure' mode: PAGE initialisation order issues."

This reverts commit e65f54f.
  • Loading branch information...
1 parent 371e726 commit 2ecbeeda93cd7adf93986bd32220cfb3a9e9c5e1 @stronk7 stronk7 committed Oct 5, 2012
Showing with 5 additions and 6 deletions.
  1. +2 −2 mod/quiz/attempt.php
  2. +1 −2 mod/quiz/review.php
  3. +2 −2 mod/quiz/summary.php
View
@@ -75,9 +75,8 @@
// Check the access rules.
$accessmanager = $attemptobj->get_access_manager(time());
-$accessmanager->setup_attempt_page($PAGE);
-$output = $PAGE->get_renderer('mod_quiz');
$messages = $accessmanager->prevent_access();
+$output = $PAGE->get_renderer('mod_quiz');
if (!$attemptobj->is_preview_user() && $messages) {
print_error('attempterror', 'quiz', $attemptobj->view_url(),
$output->access_messages($messages));
@@ -111,6 +110,7 @@
$headtags = $attemptobj->get_html_head_contributions($page);
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
$PAGE->set_heading($attemptobj->get_course()->fullname);
+$accessmanager->setup_attempt_page($PAGE);
if ($attemptobj->is_last_page($page)) {
$nextpage = -1;
View
@@ -53,8 +53,6 @@
// Create an object to manage all the other (non-roles) access rules.
$accessmanager = $attemptobj->get_access_manager(time());
-$accessmanager->setup_attempt_page($PAGE);
-
$options = $attemptobj->get_display_options(true);
// Check permissions.
@@ -106,6 +104,7 @@
$headtags = $attemptobj->get_html_head_contributions($page, $showall);
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
$PAGE->set_heading($attemptobj->get_course()->fullname);
+$accessmanager->setup_attempt_page($PAGE);
// Summary table start ============================================================================
View
@@ -57,9 +57,8 @@
// Check access.
$accessmanager = $attemptobj->get_access_manager(time());
-$accessmanager->setup_attempt_page($PAGE);
-$output = $PAGE->get_renderer('mod_quiz');
$messages = $accessmanager->prevent_access();
+$output = $PAGE->get_renderer('mod_quiz');
if (!$attemptobj->is_preview_user() && $messages) {
print_error('attempterror', 'quiz', $attemptobj->view_url(),
$output->access_messages($messages));
@@ -87,6 +86,7 @@
$PAGE->navbar->add(get_string('summaryofattempt', 'quiz'));
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
$PAGE->set_heading($attemptobj->get_course()->fullname);
+$accessmanager->setup_attempt_page($PAGE);
// Display the page.

0 comments on commit 2ecbeed

Please sign in to comment.