on-demand release 4.0dev+
[moodle.git] / question / type / multianswer / tests / behat / add.feature
CommitLineData
09fc929e
JMV
1@qtype @qtype_multianswer
2Feature: Test creating a Multianswer (Cloze) question
3 As a teacher
4 In order to test my students
5 I need to be able to create a Cloze question
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher1 | T1 | Teacher1 | teacher1@moodle.com |
11 And the following "courses" exist:
12 | fullname | shortname | category |
13 | Course 1 | C1 | 0 |
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17 And I log in as "teacher1"
18 And I am on "Course 1" course homepage
19 And I navigate to "Question bank" in current page administration
20
21 Scenario: Create a Cloze question
22 When I add a "Embedded answers (Cloze)" question filling the form with:
23 | Question name | multianswer-001 |
24 | Question text | {1:SHORTANSWER:=Berlin} is the capital of Germany. |
25 | General feedback | The capital of Germany is Berlin. |
6ffeabfd 26 Then I should see "multianswer-001" in the "categoryquestions" "table"
09fc929e
JMV
27
28 Scenario: Create a broken Cloze question and correct it
6ffeabfd 29 Given I press "Create a new question ..."
09fc929e
JMV
30 And I set the field "Embedded answers (Cloze)" to "1"
31 And I press "Add"
32 And I set the field "Question name" to "multianswer-002"
33 And I set the field "Question text" to "Please select the fruits {1:MULTICHOICE:=Apple#Correct}"
34 And I set the field "General feedback" to "Apple are delicious."
6ffeabfd 35 When I press "id_submitbutton"
09fc929e 36 Then I should see "This type of question requires at least 2 choices"
6ffeabfd 37 And I set the following fields to these values:
09fc929e
JMV
38 | Question text | Please select the fruits {1:MULTICHOICE:=Apple#Correct~Banana#Wrong} |
39 And I press "id_submitbutton"
6ffeabfd
JP
40 And I should see "multianswer-002" in the "categoryquestions" "table"
41
42 Scenario: Try to create a Cloze question that has no answer
43 Given I press "Create a new question ..."
44 And I set the field "Embedded answers (Cloze)" to "1"
45 And I press "Add"
46 And I set the following fields to these values:
47 | Question name | multianswer-003 |
48 | Question text | {1:SHORTANSWER:= } is the capital of Germany. |
49 And I press "id_submitbutton"
50 And I should see "This type of question requires at least 1 answers"