mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Merge branch 'MDL-34257' of git://github.com/timhunt/moodle
This commit is contained in:
commit
e737ad93a1
@ -76,8 +76,9 @@ if ($attemptobj->is_finished()) {
|
||||
|
||||
// Check the access rules.
|
||||
$accessmanager = $attemptobj->get_access_manager(time());
|
||||
$messages = $accessmanager->prevent_access();
|
||||
$accessmanager->setup_attempt_page($PAGE);
|
||||
$output = $PAGE->get_renderer('mod_quiz');
|
||||
$messages = $accessmanager->prevent_access();
|
||||
if (!$attemptobj->is_preview_user() && $messages) {
|
||||
print_error('attempterror', 'quiz', $attemptobj->view_url(),
|
||||
$output->access_messages($messages));
|
||||
@ -120,7 +121,6 @@ $title = get_string('attempt', 'quiz', $attemptobj->get_attempt_number());
|
||||
$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;
|
||||
|
@ -52,6 +52,8 @@ $attemptobj->check_review_capability();
|
||||
|
||||
// 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.
|
||||
@ -103,7 +105,6 @@ if ($attemptobj->is_preview_user() && $attemptobj->is_own_attempt()) {
|
||||
$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. ============================================================================
|
||||
|
||||
|
@ -52,8 +52,9 @@ if ($attemptobj->is_preview_user()) {
|
||||
|
||||
// Check access.
|
||||
$accessmanager = $attemptobj->get_access_manager(time());
|
||||
$messages = $accessmanager->prevent_access();
|
||||
$accessmanager->setup_attempt_page($PAGE);
|
||||
$output = $PAGE->get_renderer('mod_quiz');
|
||||
$messages = $accessmanager->prevent_access();
|
||||
if (!$attemptobj->is_preview_user() && $messages) {
|
||||
print_error('attempterror', 'quiz', $attemptobj->view_url(),
|
||||
$output->access_messages($messages));
|
||||
@ -89,7 +90,6 @@ $PAGE->blocks->add_fake_block($navbc, reset($regions));
|
||||
$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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user