]> git.mjollnir.org Git - moodle.git/commitdiff
quiz MDL-19813 Upgraded deprecated calls and called set_url with pre-generated var
authorsamhemelryk <samhemelryk>
Fri, 16 Oct 2009 03:20:38 +0000 (03:20 +0000)
committersamhemelryk <samhemelryk>
Fri, 16 Oct 2009 03:20:38 +0000 (03:20 +0000)
mod/quiz/addrandom.php
mod/quiz/attempt.php
mod/quiz/comment.php
mod/quiz/index.php
mod/quiz/review.php
mod/quiz/reviewquestion.php
mod/quiz/summary.php
mod/quiz/view.php

index 5568bd0fd50a6eb954248994db8a2c9562dc1efd..e08c1d1c51767bfed7817fc97b26eeb6553858bd 100644 (file)
@@ -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');
index d7f22c33f07c0ab67d06a13e93e2c4914fec15c6..051df81edb7ebbe4dd5de7d30a213869d833385a 100644 (file)
         $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());
index fe3abc3fd505c5d7ea0d6630bb242e07958c6a81..9419e02ace61a2566a54d60b09b30d6ad5e78e7e 100644 (file)
@@ -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.
index 99213c5777fac1ddc66d96611842b501c3bef357..53cfcddb3f8e8b78bef5b8f30408a69a46500422 100644 (file)
@@ -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');
     }
index 847b562999e6bd3398113aab5955aa1112edda6e..7eb76063ce2aa71642b930b697bf47ebf945a8c9 100644 (file)
@@ -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()));
index 75f21de62be5b00a0ab1a1c7156b664a223c99a4..6198176c6f411b2e60955a458c9354251aa6212b 100644 (file)
@@ -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.
     $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.
index 3140f6a7a097d118420e2a0419a14e94f6541115..999894d088758738662dd8bfb39fd09786b45e3d 100644 (file)
@@ -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()));
index 909f8612c5d9d6f9de1170084fb9ecfa17cff19c..eccfc5f597761974558233ae1e014cbfe55c7d8b 100644 (file)
@@ -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.'" />'.