Commit 92111e8d authored by Tim Hunt's avatar Tim Hunt
Browse files

MDL-27747 questions remove all references to the recently deprecated get_grade_options()

parent af2f98ee
......@@ -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)
......
......@@ -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();
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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);
......
......@@ -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();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment