Skip to content

Commit

Permalink
Revert "MDL-34257 quiz 'secure' mode: PAGE initialisation order issues."
Browse files Browse the repository at this point in the history
This reverts commit d205afe.
  • Loading branch information
stronk7 committed Oct 5, 2012
1 parent db8e84a commit 4abc5a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mod/quiz/attempt.php
Expand Up @@ -76,9 +76,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));
Expand Down Expand Up @@ -121,6 +120,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;
Expand Down
3 changes: 1 addition & 2 deletions mod/quiz/review.php
Expand Up @@ -52,8 +52,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.
Expand Down Expand Up @@ -105,6 +103,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. ============================================================================

Expand Down
4 changes: 2 additions & 2 deletions mod/quiz/summary.php
Expand Up @@ -52,9 +52,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));
Expand Down Expand Up @@ -90,6 +89,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.
echo $output->summary_page($attemptobj, $displayoptions);

0 comments on commit 4abc5a1

Please sign in to comment.