quiz MDL-19813 Upgraded deprecated calls and called set_url with pre-generated var
This commit is contained in:
@@ -54,6 +54,15 @@ if ($newquestioninfo) {
|
||||
$quiz_page = optional_param('quiz_page', 0, PARAM_SEQUENCE);
|
||||
$returnurl = optional_param('returnurl', 0, PARAM_LOCALURL);
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/mod/quiz/addrandom.php');
|
||||
if ($quiz_page != 0) {
|
||||
$url->param('quiz_page', $quiz_page);
|
||||
}
|
||||
if ($returnurl != 0) {
|
||||
$url->param('returnurl', $returnurl);
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
|
||||
$strquizzes = get_string('modulenameplural', 'quiz');
|
||||
$strquiz = get_string('modulename', 'quiz');
|
||||
$streditingquestions = get_string('editquestions', 'quiz');
|
||||
|
||||
@@ -100,8 +100,9 @@
|
||||
$accessmanager->setup_secure_page($attemptobj->get_course()->shortname . ': ' .
|
||||
format_string($attemptobj->get_quiz_name()), $headtags);
|
||||
} elseif ($accessmanager->safebrowser_required($attemptobj->is_preview_user())) {
|
||||
print_header($attemptobj->get_course()->shortname . ': '.
|
||||
format_string($attemptobj->get_quiz_name()), '', '', '', $headtags, false, '', '', false, '');
|
||||
$PAGE->set_title($attemptobj->get_course()->shortname . ': '.format_string($attemptobj->get_quiz_name()));
|
||||
$PAGE->set_cacheable(false);
|
||||
echo $OUTPUT->header();
|
||||
} else {
|
||||
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
|
||||
$PAGE->set_button($attemptobj->update_module_button());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* This page allows the teacher to enter a manual grade for a particular question.
|
||||
* This page is expected to only be used in a popup window.
|
||||
@@ -13,6 +13,8 @@
|
||||
$attemptid = required_param('attempt', PARAM_INT); // attempt id
|
||||
$questionid = required_param('question', PARAM_INT); // question id
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/quiz/comment.php', array('attempt'=>$attemptid, 'question'=>$questionid)));
|
||||
|
||||
$attemptobj = new quiz_attempt($attemptid);
|
||||
|
||||
/// Can only grade finished attempts.
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* This page lists all the instances of quiz in a particular course
|
||||
*
|
||||
@@ -10,6 +10,7 @@
|
||||
require_once("locallib.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/quiz/index.php', array('id'=>$id)));
|
||||
if (!$course = $DB->get_record('course', array('id' => $id))) {
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
|
||||
+3
-1
@@ -93,7 +93,9 @@
|
||||
if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
|
||||
$accessmanager->setup_secure_page($attemptobj->get_course()->shortname.': '.format_string($attemptobj->get_quiz_name()), $headtags);
|
||||
} elseif ($accessmanager->safebrowser_required($attemptobj->is_preview_user())) {
|
||||
print_header($attemptobj->get_course()->shortname . ': '.format_string($attemptobj->get_quiz_name()), '', '', '', $headtags, false, '', '', false, '');
|
||||
$PAGE->set_title($attemptobj->get_course()->shortname . ': '.format_string($attemptobj->get_quiz_name()));
|
||||
$PAGE->set_cacheable(false);
|
||||
echo $OUTPUT->header();
|
||||
} else {
|
||||
$attemptobj->navigation($strreviewtitle);
|
||||
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* This page prints a review of a particular question attempt.
|
||||
* This page is expected to only be used in a popup window.
|
||||
@@ -15,6 +15,12 @@
|
||||
$questionid = required_param('question', PARAM_INT); // question id
|
||||
$stateid = optional_param('state', 0, PARAM_INT); // state id
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/mod/quiz/reviewquestion.php', array('attempt'=>$attemptid,'question'=>$questionid));
|
||||
if ($stateid !== 0) {
|
||||
$url->param('state', $stateid);
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
|
||||
$attemptobj = new quiz_attempt($attemptid);
|
||||
|
||||
/// Check login.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* This page prints a summary of a quiz attempt before it is submitted.
|
||||
*
|
||||
@@ -11,6 +11,9 @@ require_once(dirname(__FILE__) . '/../../config.php');
|
||||
require_once($CFG->dirroot . '/mod/quiz/locallib.php');
|
||||
|
||||
$attemptid = required_param('attempt', PARAM_INT); // The attempt to summarise.
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/quiz/summary.php', array('attempt'=>$attemptid)));
|
||||
|
||||
$attemptobj = new quiz_attempt($attemptid);
|
||||
|
||||
/// Check login.
|
||||
@@ -50,8 +53,9 @@ if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
|
||||
$accessmanager->setup_secure_page($attemptobj->get_course()->shortname . ': ' .
|
||||
format_string($attemptobj->get_quiz_name()), '');
|
||||
} elseif ($accessmanager->safebrowser_required($attemptobj->is_preview_user())) {
|
||||
print_header($attemptobj->get_course()->shortname . ': '.
|
||||
format_string($attemptobj->get_quiz_name()), '', '', '', '', false, '', '', false, '');
|
||||
$PAGE->set_title($attemptobj->get_course()->shortname . ': '.format_string($attemptobj->get_quiz_name()));
|
||||
$PAGE->set_cacheable(false);
|
||||
echo $OUTPUT->header();
|
||||
} else {
|
||||
$attemptobj->navigation($title);
|
||||
$PAGE->set_title(format_string($attemptobj->get_quiz_name()));
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@
|
||||
// The code will be much nicer than this eventually.
|
||||
$title = $course->shortname . ': ' . format_string($quiz->name);
|
||||
|
||||
$buttons = '<table><tr><td>'.update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')).'</td>';
|
||||
$buttons = '<table><tr><td>'.$OUTPUT->update_module_button($cm->id, $cm->modname).'</td>';
|
||||
if ($PAGE->user_allowed_editing() && !empty($CFG->showblocksonmodpages)) {
|
||||
$buttons .= '<td><form '.$CFG->frametarget.' method="get" action="view.php"><div>'.
|
||||
'<input type="hidden" name="id" value="'.$cm->id.'" />'.
|
||||
|
||||
Reference in New Issue
Block a user