]> git.mjollnir.org Git - moodle.git/commitdiff
quiz editing: MDL-17293 changed how the page number to add on is passed to the form...
authorpilpi <pilpi>
Sat, 22 Nov 2008 16:32:36 +0000 (16:32 +0000)
committerpilpi <pilpi>
Sat, 22 Nov 2008 16:32:36 +0000 (16:32 +0000)
mod/quiz/addrandom.php
question/category_class.php
question/category_form_randomquestion.php

index cdad500252cc668cb5772739120a260d47c40a36..bb0e6d7030412d3e9cf3dafab1d49460140f29fd 100644 (file)
@@ -67,7 +67,8 @@
 
     print_heading(get_string("addrandomquestiontoquiz","quiz",$quizname), 'left', 2);
 
-    $qcobject->display_randomquestion_user_interface();
+    $addonpage=optional_param("addonpage_form", 0, PARAM_SEQUENCE);
+    $qcobject->display_randomquestion_user_interface($addonpage);
 
     print_footer($course);
 ?>
\ No newline at end of file
index d65f0946f931325da032a962e4b07861e9666db1..2c94c77378f5354524eea974fe34fb2892717757 100644 (file)
@@ -228,8 +228,8 @@ class question_category_object {
      * Displays the user interface
      *
      */
-    function display_randomquestion_user_interface() {
-
+    function display_randomquestion_user_interface($addonpage) {
+        $this->catform_rand->set_data(array('addonpage'=>$addonpage));
         /// Interface for adding a new category:
         $this->output_new_randomquestion_table();
 
index cde516caa2677b937538f3b5845a98a3b8abbfb9..d06efaa5f8d8633f29ce64dfa73baa4caf32ef6d 100644 (file)
@@ -41,8 +41,7 @@ class question_category_edit_form_randomquestion extends moodleform {
 //--------------------------------------------------------------------------------
         $mform->addElement('hidden', 'id', 0);
         $mform->setType('id', PARAM_INT);
-        //TODO: Tim: is this questionable? to add a hidden field right from a get parameter?
-        $mform->addElement('hidden', 'addonpage', optional_param("addonpage_form", 0, PARAM_SEQUENCE), 'id="rform_qpage"');
+        $mform->addElement('hidden', 'addonpage', 0, 'id="rform_qpage"');
         $mform->setType('addonpage', PARAM_SEQUENCE);
     }
 }