2 Feature: Test creating different types of feedback questions
3 In order to create feedbacks
5 I need to be able to add different question types
8 Given the following "users" exist:
9 | username | firstname | lastname |
10 | teacher1 | Teacher | 1 |
11 | student1 | Student | 1 |
12 | student2 | Student | 2 |
13 And the following "courses" exist:
14 | fullname | shortname |
16 And the following "course enrolments" exist:
17 | user | course | role |
18 | teacher1 | C1 | editingteacher |
19 | student1 | C1 | student |
20 | student2 | C1 | student |
21 And I log in as "admin"
22 And I navigate to "Manage activities" node in "Site administration > Plugins > Activity modules"
23 And I click on "Show" "link" in the "Feedback" "table_row"
25 And the following "activities" exist:
26 | activity | name | course | idnumber |
27 | feedback | Learning experience | C1 | feedback0 |
28 When I log in as "teacher1"
29 And I follow "Course 1"
30 And I follow "Learning experience"
31 And I follow "Edit questions"
32 And I add a "Information" question to the feedback with:
33 | Question | this is an information question |
35 | Information-Type | Course |
36 And I add a "Label" question to the feedback with:
37 | Contents | label text |
38 And I add a "Longer text answer" question to the feedback with:
39 | Question | this is a longer text answer |
40 | Label | longertext |
41 And I add a "Multiple choice" question to the feedback with:
42 | Question | this is a multiple choice 1 |
43 | Label | multichoice1 |
44 | Multiple choice type | Multiple choice - single answer |
45 | Multiple choice values | option a\noption b\noption c |
46 And I add a "Multiple choice" question to the feedback with:
47 | Question | this is a multiple choice 2 |
48 | Label | multichoice2 |
49 | Multiple choice type | Multiple choice - multiple answers |
50 | Hide the "Not selected" option | Yes |
51 | Multiple choice values | option d\noption e\noption f |
52 And I add a "Multiple choice" question to the feedback with:
53 | Question | this is a multiple choice 3 |
54 | Label | multichoice3 |
55 | Multiple choice type | Multiple choice - single answer allowed (dropdownlist) |
56 | Multiple choice values | option g\noption h\noption i |
57 And I add a "Multiple choice (rated)" question to the feedback with:
58 | Question | this is a multiple choice rated |
59 | Label | multichoice4 |
60 | Multiple choice type | Multiple choice - single answer |
61 | Multiple choice values | 0/option k\n1/option l\n5/option m |
62 And I add a "Numeric answer" question to the feedback with:
63 | Question | this is a numeric answer |
66 And I add a "Short text answer" question to the feedback with:
67 | Question | this is a short text answer |
69 | Maximum characters accepted | 200 |
71 And I log in as "student1"
72 And I follow "Course 1"
73 And I follow "Learning experience"
74 And I follow "Answer the questions..."
75 And I set the following fields to these values:
76 | this is a longer text answer | my long answer |
80 | this is a multiple choice 3 | option h |
82 | this is a numeric answer (0 - 100) | 35 |
83 | this is a short text answer | hello |
84 And I press "Submit your answers"
86 And I log in as "student2"
87 And I follow "Course 1"
88 And I follow "Learning experience"
89 And I follow "Answer the questions..."
90 And I set the following fields to these values:
91 | this is a longer text answer | lots of feedbacks |
95 | this is a multiple choice 3 | option i |
97 | this is a numeric answer (0 - 100) | 71 |
98 | this is a short text answer | no way |
99 And I press "Submit your answers"
101 When I log in as "teacher1"
102 And I follow "Course 1"
103 And I follow "Learning experience"
104 And I follow "Analysis"
105 And I should see "Submitted answers: 2"
106 And I should see "Questions: 8"
108 And I log in as "teacher1"
109 And I follow "Course 1"
110 And I follow "Learning experience"
111 And I follow "Analysis"
112 And I should see "C1" in the "(info)" "table"
113 And I should see "my long answer" in the "(longertext)" "table"
114 And I should see "lots of feedbacks" in the "(longertext)" "table"
115 And I should see "2 (100.00 %)" in the "option d:" "table_row"
116 And I should see "1 (50.00 %)" in the "option e:" "table_row"
117 And I should see "1 (50.00 %)" in the "option f:" "table_row"
118 And I should see "0" in the "option g:" "table_row"
119 And I should not see "%" in the "option g:" "table_row"
120 And I should see "1 (50.00 %)" in the "option h:" "table_row"
121 And I should see "1 (50.00 %)" in the "option i:" "table_row"
122 And I should see "0" in the "option k (0):" "table_row"
123 And I should not see "%" in the "option k (0):" "table_row"
124 And I should see "1 (50.00 %)" in the "option l (1):" "table_row"
125 And I should see "1 (50.00 %)" in the "option m (5):" "table_row"
126 And I should see "Average: 3.00" in the "(multichoice4)" "table"
127 And I should see "35.00" in the "(numeric)" "table"
128 And I should see "71.00" in the "(numeric)" "table"
129 And I should see "Average: 53.00" in the "(numeric)" "table"
130 And I should see "no way" in the "(shorttext)" "table"
131 And I should see "hello" in the "(shorttext)" "table"
133 Scenario: Create different types of questions in feedback with javascript disabled
137 Scenario: Create different types of questions in feedback with javascript enabled
138 And I should see "1 (50.00 %)" in the "option a:" "table_row"
139 And I should see "1 (50.00 %)" in the "option b:" "table_row"