From: pilpi Date: Sat, 22 Nov 2008 16:32:36 +0000 (+0000) Subject: quiz editing: MDL-17293 changed how the page number to add on is passed to the form... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5c8505d034ed7e5be6b2c534b232c1570bd5c9c0;p=moodle.git quiz editing: MDL-17293 changed how the page number to add on is passed to the form for creating a random question --- diff --git a/mod/quiz/addrandom.php b/mod/quiz/addrandom.php index cdad500252..bb0e6d7030 100644 --- a/mod/quiz/addrandom.php +++ b/mod/quiz/addrandom.php @@ -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 diff --git a/question/category_class.php b/question/category_class.php index d65f0946f9..2c94c77378 100644 --- a/question/category_class.php +++ b/question/category_class.php @@ -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(); diff --git a/question/category_form_randomquestion.php b/question/category_form_randomquestion.php index cde516caa2..d06efaa5f8 100644 --- a/question/category_form_randomquestion.php +++ b/question/category_form_randomquestion.php @@ -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); } }