Merge branch 'MDL-28491' of git://github.com/timhunt/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 18 Oct 2011 09:08:15 +0000 (11:08 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 18 Oct 2011 09:08:15 +0000 (11:08 +0200)
1  2 
mod/quiz/summary.php

diff --combined mod/quiz/summary.php
@@@ -63,9 -63,7 +63,9 @@@ if (!$attemptobj->is_preview_user() && 
      print_error('attempterror', 'quiz', $attemptobj->view_url(),
              $output->print_messages($messages));
  }
 -$accessmanager->do_password_check($attemptobj->is_preview_user());
 +if ($accessmanager->is_preflight_check_required($attemptobj->get_attemptid())) {
 +    redirect($attemptobj->start_attempt_url(null, $page));
 +}
  
  $displayoptions = $attemptobj->get_display_options(false);
  
@@@ -79,16 -77,24 +79,16 @@@ if (empty($attemptobj->get_quiz()->show
      $PAGE->blocks->show_only_fake_blocks();
  }
  
- $navbc = $attemptobj->get_navigation_panel($output, 'quiz_attempt_nav_panel', $page);
+ $navbc = $attemptobj->get_navigation_panel($output, 'quiz_attempt_nav_panel', -1);
  $firstregion = reset($PAGE->blocks->get_regions());
  $PAGE->blocks->add_fake_block($navbc, $firstregion);
  
 -if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
 -    $accessmanager->setup_secure_page($attemptobj->get_course()->shortname . ': ' .
 -            format_string($attemptobj->get_quiz_name()), '');
 -} else if ($accessmanager->safebrowser_required($attemptobj->is_preview_user())) {
 -    $PAGE->set_title($attemptobj->get_course()->shortname . ': ' .
 -            format_string($attemptobj->get_quiz_name()));
 -    $PAGE->set_heading($attemptobj->get_course()->fullname);
 -    $PAGE->set_cacheable(false);
 -} else {
 -    $PAGE->navbar->add(get_string('summaryofattempt', 'quiz'));
 -    $PAGE->set_title(format_string($attemptobj->get_quiz_name()));
 -    $PAGE->set_heading($attemptobj->get_course()->fullname);
 -}
 +$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.
 -$accessmanager->show_attempt_timer_if_needed($attemptobj->get_attempt(), time());
 +
 +$accessmanager->show_attempt_timer_if_needed($attemptobj->get_attempt(), time(), $output);
  echo $output->summary_page($attemptobj, $displayoptions);