From 92111e8d2ccb346fcaaf7ec91bc72fffeb9518ab Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 7 Jun 2011 14:00:07 +0100 Subject: [PATCH] MDL-27747 questions remove all references to the recently deprecated get_grade_options() --- question/format.php | 3 +-- question/type/calculated/edit_calculated_form.php | 4 +--- question/type/calculatedmulti/edit_calculatedmulti_form.php | 3 +-- question/type/calculatedsimple/edit_calculatedsimple_form.php | 3 +-- question/type/missingtype/edit_missingtype_form.php | 3 +-- question/type/multichoice/edit_multichoice_form.php | 3 +-- question/type/numerical/edit_numerical_form.php | 3 +-- question/type/shortanswer/edit_shortanswer_form.php | 3 +-- 8 files changed, 8 insertions(+), 17 deletions(-) diff --git a/question/format.php b/question/format.php index 23fbdcaaf2d..af5e464b385 100644 --- a/question/format.php +++ b/question/format.php @@ -304,8 +304,7 @@ class qformat_default { } // get list of valid answer grades - $grades = get_grade_options(); - $gradeoptionsfull = $grades->gradeoptionsfull; + $gradeoptionsfull = question_bank::fraction_options_full(); // check answer grades are valid // (now need to do this here because of 'stop on error': MDL-10689) diff --git a/question/type/calculated/edit_calculated_form.php b/question/type/calculated/edit_calculated_form.php index ee4c8aefe68..cd79a8f9ebf 100644 --- a/question/type/calculated/edit_calculated_form.php +++ b/question/type/calculated/edit_calculated_form.php @@ -146,10 +146,8 @@ class qtype_calculated_edit_form extends qtype_numerical_edit_form { $mform->addElement('hidden', 'answernumbering', 'abc'); $mform->setType('answernumbering', PARAM_SAFEDIR); - $creategrades = get_grade_options(); - $this->add_per_answer_fields($mform, get_string('answerhdr', 'qtype_calculated', '{no}'), - $creategrades->gradeoptions, 1, 1); + question_bank::fraction_options(), 1, 1); $repeated = array(); diff --git a/question/type/calculatedmulti/edit_calculatedmulti_form.php b/question/type/calculatedmulti/edit_calculatedmulti_form.php index c8f93ab7f0f..d2d93f5051a 100644 --- a/question/type/calculatedmulti/edit_calculatedmulti_form.php +++ b/question/type/calculatedmulti/edit_calculatedmulti_form.php @@ -147,9 +147,8 @@ class qtype_calculatedmulti_edit_form extends question_edit_form { get_string('answernumbering', 'qtype_multichoice'), $numberingoptions); $mform->setDefault('answernumbering', 'abc'); - $creategrades = get_grade_options(); $this->add_per_answer_fields($mform, get_string('choiceno', 'qtype_multichoice', '{no}'), - $creategrades->gradeoptionsfull, max(5, QUESTION_NUMANS_START)); + question_bank::fraction_options_full(), max(5, QUESTION_NUMANS_START)); $repeated = array(); // if ($this->editasmultichoice == 1) { diff --git a/question/type/calculatedsimple/edit_calculatedsimple_form.php b/question/type/calculatedsimple/edit_calculatedsimple_form.php index 132e7ed79b9..ad18e37cee1 100644 --- a/question/type/calculatedsimple/edit_calculatedsimple_form.php +++ b/question/type/calculatedsimple/edit_calculatedsimple_form.php @@ -331,9 +331,8 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form { $addstring = get_string("updatecategory", "qtype_calculated"); $mform->registerNoSubmitButton($addfieldsname); - $creategrades = get_grade_options(); $this->add_per_answer_fields($mform, get_string('answerhdr', 'qtype_calculated', '{no}'), - $creategrades->gradeoptions, 1, 1); + question_bank::fraction_options(), 1, 1); $this->add_unit_options($mform, $this); $this->add_unit_fields($mform, $this); diff --git a/question/type/missingtype/edit_missingtype_form.php b/question/type/missingtype/edit_missingtype_form.php index 1905238605b..128f3ababee 100644 --- a/question/type/missingtype/edit_missingtype_form.php +++ b/question/type/missingtype/edit_missingtype_form.php @@ -45,9 +45,8 @@ class qtype_missingtype_edit_form extends question_edit_form { * @param object $mform the form being built. */ protected function definition_inner($mform) { - $creategrades = get_grade_options(); $this->add_per_answer_fields($mform, get_string('answerno', 'qtype_missingtype', '{no}'), - $creategrades->gradeoptionsfull); + question_bank::fraction_options_full()); } public function set_data($question) { diff --git a/question/type/multichoice/edit_multichoice_form.php b/question/type/multichoice/edit_multichoice_form.php index 453bff1c7bc..3a46415b535 100644 --- a/question/type/multichoice/edit_multichoice_form.php +++ b/question/type/multichoice/edit_multichoice_form.php @@ -58,9 +58,8 @@ class qtype_multichoice_edit_form extends question_edit_form { qtype_multichoice::get_numbering_styles()); $mform->setDefault('answernumbering', 'abc'); - $creategrades = get_grade_options(); $this->add_per_answer_fields($mform, get_string('choiceno', 'qtype_multichoice', '{no}'), - $creategrades->gradeoptionsfull, max(5, QUESTION_NUMANS_START)); + question_bank::fraction_options_full(), max(5, QUESTION_NUMANS_START)); $this->add_combined_feedback_fields(true); $mform->disabledIf('shownumcorrect', 'single', 'eq', 1); diff --git a/question/type/numerical/edit_numerical_form.php b/question/type/numerical/edit_numerical_form.php index 17f32dcc1f8..38922a8b70e 100644 --- a/question/type/numerical/edit_numerical_form.php +++ b/question/type/numerical/edit_numerical_form.php @@ -38,9 +38,8 @@ require_once($CFG->dirroot . '/question/type/numerical/questiontype.php'); class qtype_numerical_edit_form extends question_edit_form { protected function definition_inner($mform) { - $creategrades = get_grade_options(); $this->add_per_answer_fields($mform, get_string('answerno', 'qtype_numerical', '{no}'), - $creategrades->gradeoptions); + question_bank::fraction_options()); $this->add_unit_options($mform); $this->add_unit_fields($mform); diff --git a/question/type/shortanswer/edit_shortanswer_form.php b/question/type/shortanswer/edit_shortanswer_form.php index c6663cf4af7..49fabf2abae 100644 --- a/question/type/shortanswer/edit_shortanswer_form.php +++ b/question/type/shortanswer/edit_shortanswer_form.php @@ -48,9 +48,8 @@ class qtype_shortanswer_edit_form extends question_edit_form { get_string('filloutoneanswer', 'qtype_shortanswer')); $mform->closeHeaderBefore('answersinstruct'); - $creategrades = get_grade_options(); $this->add_per_answer_fields($mform, get_string('answerno', 'qtype_shortanswer', '{no}'), - $creategrades->gradeoptions); + question_bank::fraction_options()); $this->add_interactive_settings(); }