Fix behat tests for exercises

Fix 5687f738b3
pull/2487/head
Angel Fernando Quiroz Campos 9 years ago
parent e293ba8b68
commit b5657333ef
  1. 11
      main/exercise/multiple_answer.class.php
  2. 11
      main/exercise/unique_answer.class.php
  3. 4
      tests/behat/features/toolExercise.feature

@ -156,7 +156,16 @@ class MultipleAnswer extends Question
// setting the save button here and not in the question class.php
$buttonGroup[] = $form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers', true);
$buttonGroup[] = $form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers', true);
$buttonGroup[] = $form->addButtonSave($text, 'submitQuestion', true);
$buttonGroup[] = $form->addButton(
'submitQuestion',
$text,
'check',
'primary',
'default',
null,
['id' => 'submit-question'],
true
);
}
$form->addGroup($buttonGroup);

@ -282,7 +282,16 @@ class UniqueAnswer extends Question
//setting the save button here and not in the question class.php
$buttonGroup[] = $form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers', true);
$buttonGroup[] = $form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers', true);
$buttonGroup[] = $form->addButtonSave($text, 'submitQuestion', true);
$buttonGroup[] = $form->addButton(
'submitQuestion',
$text,
'check',
'primary',
'default',
null,
['id' => 'submit-question'],
true
);
$form->addGroup($buttonGroup);
}

@ -59,7 +59,7 @@ Feature: Exercise tool
Then I fill in ckeditor field "comment[2]" with "Comment false"
Then I fill in ckeditor field "comment[3]" with "Comment false"
Then I fill in ckeditor field "comment[4]" with "Comment false"
And I press "submitQuestion"
And I press "submit-question"
Then I should see "Item added"
Scenario: Add question "Multiple answer" to exercise created "Exercise 1"
@ -80,7 +80,7 @@ Feature: Exercise tool
Then I fill in ckeditor field "comment[2]" with "Comment false"
Then I fill in ckeditor field "comment[3]" with "Comment false"
Then I fill in ckeditor field "comment[4]" with "Comment false"
And I press "submitQuestion"
And I press "submit-question"
Then I should see "Item added"
Scenario: Add question "Fill in blanks" to "Exercise 1"

Loading…
Cancel
Save