-
Bug
-
Resolution: Fixed
-
Minor
-
3.5.3
-
MOODLE_35_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
Looking at the code here:
https://github.com/moodle/moodle/blob/master/question/type/gapselect/edit_form_base.php
Around line 227 One sees the following code:
protected function data_preprocessing_choice($question, $answer, $key) { |
// See comment in data_preprocessing_answers. |
unset($this->_form->_defaultValues['choices[$key][choicegroup]']); |
$question->choices[$key]['answer'] = $answer->answer; |
$question->choices[$key]['choicegroup'] = $answer->feedback; |
return $question; |
}
|
Note the use of single quotes in the line:
unset($this->_form->_defaultValues['choices[$key][choicegroup]']);
This looks wrong because the $key won't be expanded.
Presumably this should either use double quotes or the following form:
unset($this->_form->_defaultValues['choices[' . $key . '][choicegroup]']);