Commit aa4dcee7 authored by Tim Hunt's avatar Tim Hunt
Browse files

MDL-46681 qtype_multichoice: disabled unused options

For questions set to 'One answer only', the 'Clear incorrect responses'
and 'Show the number of correct responses' hint options make not sense,
and are not used. Hence we disableIf them.
parent 14cb870f
......@@ -82,6 +82,13 @@ class qtype_multichoice_edit_form extends question_edit_form {
return $repeated;
}
protected function get_hint_fields($withclearwrong = false, $withshownumpartscorrect = false) {
list($repeated, $repeatedoptions) = parent::get_hint_fields($withclearwrong, $withshownumpartscorrect);
$repeatedoptions['hintclearwrong']['disabledif'] = array('single', 'eq', 1);
$repeatedoptions['hintshownumcorrect']['disabledif'] = array('single', 'eq', 1);
return array($repeated, $repeatedoptions);
}
protected function data_preprocessing($question) {
$question = parent::data_preprocessing($question);
$question = $this->data_preprocessing_answers($question, true);
......
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