diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php index 06ff98611197b..16058ad8c09a5 100644 --- a/question/type/edit_question_form.php +++ b/question/type/edit_question_form.php @@ -613,7 +613,7 @@ protected function data_preprocessing_extra_answer_fields($question, $extraanswe foreach ($question->options->answers as $answer) { foreach ($extraanswerfields as $field) { // See hack comment in {@link data_preprocessing_answers()}. - unset($this->_form->_defaultValues["$field[$key]"]); + unset($this->_form->_defaultValues["{$field}[{$key}]"]); $extrafieldsdata[$field][$key] = $this->data_preprocessing_extra_answer_field($answer, $field); } $key++;