diff --git a/question/type/gapselect/edit_form_base.php b/question/type/gapselect/edit_form_base.php index bd26c77c168..fb861d5306c 100644 --- a/question/type/gapselect/edit_form_base.php +++ b/question/type/gapselect/edit_form_base.php @@ -225,8 +225,6 @@ class qtype_gapselect_edit_form_base extends question_edit_form { } 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; diff --git a/question/type/gapselect/tests/behat/basic_test.feature b/question/type/gapselect/tests/behat/basic_test.feature index d7f9a331ad3..9ae9e369ba0 100644 --- a/question/type/gapselect/tests/behat/basic_test.feature +++ b/question/type/gapselect/tests/behat/basic_test.feature @@ -27,9 +27,12 @@ Feature: Test all the basic functionality of this question type | General feedback | The cat sat on the mat. | | id_choices_0_answer | cat | | id_choices_1_answer | sat | + | id_choices_1_choicegroup | 2 | | id_choices_2_answer | mat | | id_choices_3_answer | dog | | id_choices_4_answer | table | + | id_choices_5_answer | ran | + | id_choices_5_choicegroup | 2 | | Hint 1 | First hint | | Hint 2 | Second hint | Then I should see "Select missing words 001" @@ -48,8 +51,8 @@ Feature: Test all the basic functionality of this question type | How questions behave | Interactive with multiple tries | | Marked out of | 3 | | Marks | Show mark and max | - | Specific feedback | Shown | - | Right answer | Shown | + | Specific feedback | Shown | + | Right answer | Shown | And I press "Start again with these options" # Answer question correctly @@ -113,8 +116,8 @@ Feature: Test all the basic functionality of this question type # Answer question incorrectly And I set space "1" to "mat" in the select missing words question - And I set space "2" to "cat" in the select missing words question - And I set space "3" to "sat" in the select missing words question + And I set space "2" to "ran" in the select missing words question + And I set space "3" to "table" in the select missing words question And I press "Check" Then I should see "Your answer is incorrect" And I should see "The cat sat on the mat" @@ -140,9 +143,12 @@ Feature: Test all the basic functionality of this question type | General feedback | The cat sat on the mat. | | id_choices_0_answer | cat | | id_choices_1_answer | sat | + | id_choices_1_choicegroup | 2 | | id_choices_2_answer | mat | | id_choices_3_answer | dog | | id_choices_4_answer | table | + | id_choices_5_answer | ran | + | id_choices_5_choicegroup | 2 | | Hint 1 | First hint | | Hint 2 | Second hint | And I set the following fields to these values: