diff --git a/question/type/calculated/datasetitems_form.php b/question/type/calculated/datasetitems_form.php index 317ac6f6f6d..43b2c9d36f1 100644 --- a/question/type/calculated/datasetitems_form.php +++ b/question/type/calculated/datasetitems_form.php @@ -183,6 +183,7 @@ class question_dataset_dependent_items_form extends question_wizard_form { $answer->answer); $mform->addElement('text', 'tolerance['.$key.']', get_string('tolerance', 'qtype_calculated')); + $mform->setType('tolerance['.$key.']', PARAM_RAW); $mform->setAdvanced('tolerance['.$key.']', true); $mform->addElement('select', 'tolerancetype['.$key.']', get_string('tolerancetype', 'qtype_numerical'), diff --git a/question/type/numerical/edit_numerical_form.php b/question/type/numerical/edit_numerical_form.php index 4ca7b506518..2554177cc2e 100644 --- a/question/type/numerical/edit_numerical_form.php +++ b/question/type/numerical/edit_numerical_form.php @@ -145,10 +145,11 @@ class qtype_numerical_edit_form extends question_edit_form { $unitfields = array($mform->createElement('group', 'units', get_string('unitx', 'qtype_numerical'), $this->unit_group($mform), null, false)); - $repeatedoptions['unit']['disabledif'] = - array('unitrole', 'eq', qtype_numerical::UNITNONE); - $repeatedoptions['multiplier']['disabledif'] = - array('unitrole', 'eq', qtype_numerical::UNITNONE); + $repeatedoptions['unit']['disabledif'] = array('unitrole', 'eq', qtype_numerical::UNITNONE); + $repeatedoptions['unit']['type'] = PARAM_NOTAGS; + $repeatedoptions['multiplier']['disabledif'] = array('unitrole', 'eq', qtype_numerical::UNITNONE); + $repeatedoptions['multiplier']['type'] = PARAM_NUMBER; + $mform->disabledIf('addunits', 'unitrole', 'eq', qtype_numerical::UNITNONE); if (isset($this->question->options->units)) { @@ -184,12 +185,11 @@ class qtype_numerical_edit_form extends question_edit_form { */ protected function unit_group($mform) { $grouparray = array(); - $grouparray[] = $mform->createElement('text', 'unit', get_string('unit', 'quiz'), - array('type'=>PARAM_NOTAGS, 'size'=>10)); + $grouparray[] = $mform->createElement('text', 'unit', get_string('unit', 'quiz'), array('size'=>10)); $grouparray[] = $mform->createElement('static', '', '', ' ' . get_string('multiplier', 'quiz').' '); $grouparray[] = $mform->createElement('text', 'multiplier', - get_string('multiplier', 'quiz'), array('type'=>PARAM_NUMBER, 'size'=>10)); + get_string('multiplier', 'quiz'), array('size'=>10)); return $grouparray; }