1 |
efrain |
1 |
@core @core_course @core_courseformat @core_completion
|
|
|
2 |
Feature: Course page activities completion
|
|
|
3 |
In order to check activities completions
|
|
|
4 |
As a student
|
|
|
5 |
I need to see the activity completion criterias dropdown.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| shortname | fullname | enablecompletion |
|
|
|
14 |
| C1 | Course 1 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student1 | C1 | student |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
|
|
|
20 |
Scenario: Teacher does not see manual completion button
|
|
|
21 |
Given the following "activity" exists:
|
|
|
22 |
| activity | assign |
|
|
|
23 |
| name | Activity sample |
|
|
|
24 |
| course | C1 |
|
|
|
25 |
| completion | 1 |
|
|
|
26 |
| completionview | 0 |
|
|
|
27 |
When I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
28 |
Then "Mark as done" "button" should not exist in the "Activity sample" "activity"
|
|
|
29 |
And the "Mark as done" item should exist in the "Completion" dropdown of the "Activity sample" "activity"
|
|
|
30 |
|
|
|
31 |
@javascript
|
|
|
32 |
Scenario: Student should see the manual completion button
|
|
|
33 |
Given the following "activity" exists:
|
|
|
34 |
| activity | assign |
|
|
|
35 |
| name | Activity sample |
|
|
|
36 |
| course | C1 |
|
|
|
37 |
| completion | 1 |
|
|
|
38 |
| completionview | 0 |
|
|
|
39 |
When I am on the "C1" "Course" page logged in as "student1"
|
|
|
40 |
Then the manual completion button for "Activity sample" should exist
|
|
|
41 |
And the manual completion button of "Activity sample" is displayed as "Mark as done"
|
|
|
42 |
And I toggle the manual completion state of "Activity sample"
|
|
|
43 |
And the manual completion button of "Activity sample" is displayed as "Done"
|
|
|
44 |
|
|
|
45 |
Scenario: Teacher should see the automatic completion criterias of activities
|
|
|
46 |
Given the following "activity" exists:
|
|
|
47 |
| activity | assign |
|
|
|
48 |
| name | Activity sample |
|
|
|
49 |
| course | C1 |
|
|
|
50 |
| completion | 2 |
|
|
|
51 |
| completionview | 1 |
|
|
|
52 |
When I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
53 |
And the "View" item should exist in the "Completion" dropdown of the "Activity sample" "activity"
|
|
|
54 |
# After viewing the activity, the completion criteria dropdown should still display "Completion".
|
|
|
55 |
And I am on the "Activity sample" "assign Activity" page
|
|
|
56 |
And I am on the "Course 1" course page
|
|
|
57 |
And "Completion" "button" should exist in the "Activity sample" "activity"
|
|
|
58 |
|
|
|
59 |
Scenario: Student should see the automatic completion criterias statuses of activities with completion view
|
|
|
60 |
Given the following "activity" exists:
|
|
|
61 |
| activity | assign |
|
|
|
62 |
| name | Activity sample |
|
|
|
63 |
| course | C1 |
|
|
|
64 |
| completion | 2 |
|
|
|
65 |
| completionview | 1 |
|
|
|
66 |
When I am on the "C1" "Course" page logged in as "student1"
|
|
|
67 |
And the "View" item should exist in the "To do" dropdown of the "Activity sample" "activity"
|
|
|
68 |
# After viewing the activity, the completion criteria dropdown should display "Done" instead of "To do".
|
|
|
69 |
And I am on the "Activity sample" "assign Activity" page
|
|
|
70 |
And I am on the "Course 1" course page
|
|
|
71 |
And "To do" "button" should not exist in the "Activity sample" "activity"
|
|
|
72 |
And the "View" item should exist in the "Done" dropdown of the "Activity sample" "activity"
|
|
|
73 |
|
|
|
74 |
Scenario: Student should see the automatic completion criterias statuses of activities with completion grade
|
|
|
75 |
Given the following "activities" exist:
|
|
|
76 |
| activity | name | course | idnumber | gradepass | completion | completionusegrade |
|
|
|
77 |
| quiz | Activity sample 1 | C1 | quiz1 | 5.00 | 2 | 1 |
|
|
|
78 |
| quiz | Activity sample 2 | C1 | quiz2 | 5.00 | 2 | 1 |
|
|
|
79 |
And the following "question categories" exist:
|
|
|
80 |
| contextlevel | reference | name |
|
|
|
81 |
| Course | C1 | Test questions |
|
|
|
82 |
And the following "questions" exist:
|
|
|
83 |
| questioncategory | qtype | name | questiontext |
|
|
|
84 |
| Test questions | truefalse | First question | Answer the first question |
|
|
|
85 |
And quiz "Activity sample 1" contains the following questions:
|
|
|
86 |
| question | page |
|
|
|
87 |
| First question | 1 |
|
|
|
88 |
And quiz "Activity sample 2" contains the following questions:
|
|
|
89 |
| question | page |
|
|
|
90 |
| First question | 1 |
|
|
|
91 |
When I am on the "C1" "Course" page logged in as "student1"
|
|
|
92 |
Then the "Receive a grade" item should exist in the "To do" dropdown of the "Activity sample 1" "activity"
|
|
|
93 |
And the "Receive a grade" item should exist in the "To do" dropdown of the "Activity sample 2" "activity"
|
|
|
94 |
# Pass grade.
|
|
|
95 |
And user "student1" has attempted "Activity sample 1" with responses:
|
|
|
96 |
| slot | response |
|
|
|
97 |
| 1 | True |
|
|
|
98 |
# Fail grade.
|
|
|
99 |
And user "student1" has attempted "Activity sample 2" with responses:
|
|
|
100 |
| slot | response |
|
|
|
101 |
| 1 | False |
|
|
|
102 |
# After receiving a grade, the completion criteria dropdown should display "Done" instead of "To do", regardless of pass/fail.
|
|
|
103 |
And I am on the "Course 1" course page
|
|
|
104 |
And "To do" "button" should not exist in the "Activity sample 1" "activity"
|
|
|
105 |
And the "Receive a grade" item should exist in the "Done" dropdown of the "Activity sample 1" "activity"
|
|
|
106 |
And "To do" "button" should not exist in the "Activity sample 2" "activity"
|
|
|
107 |
And the "Receive a grade" item should exist in the "Done" dropdown of the "Activity sample 2" "activity"
|
|
|
108 |
|
|
|
109 |
Scenario: Student should see the automatic completion criterias statuses of activities with completion passgrade
|
|
|
110 |
Given the following "activities" exist:
|
|
|
111 |
| activity | name | course | idnumber | gradepass | completion | completionusegrade | completionpassgrade |
|
|
|
112 |
| quiz | Activity sample 1 | C1 | quiz1 | 5.00 | 2 | 1 | 1 |
|
|
|
113 |
| quiz | Activity sample 2 | C1 | quiz2 | 5.00 | 2 | 1 | 1 |
|
|
|
114 |
And the following "question categories" exist:
|
|
|
115 |
| contextlevel | reference | name |
|
|
|
116 |
| Course | C1 | Test questions |
|
|
|
117 |
And the following "questions" exist:
|
|
|
118 |
| questioncategory | qtype | name | questiontext |
|
|
|
119 |
| Test questions | truefalse | First question | Answer the first question |
|
|
|
120 |
And quiz "Activity sample 1" contains the following questions:
|
|
|
121 |
| question | page |
|
|
|
122 |
| First question | 1 |
|
|
|
123 |
And quiz "Activity sample 2" contains the following questions:
|
|
|
124 |
| question | page |
|
|
|
125 |
| First question | 1 |
|
|
|
126 |
When I am on the "C1" "Course" page logged in as "student1"
|
|
|
127 |
Then the "Receive a grade" item should exist in the "To do" dropdown of the "Activity sample 1" "activity"
|
|
|
128 |
And the "Receive a grade" item should exist in the "To do" dropdown of the "Activity sample 2" "activity"
|
|
|
129 |
# Pass grade.
|
|
|
130 |
And user "student1" has attempted "Activity sample 1" with responses:
|
|
|
131 |
| slot | response |
|
|
|
132 |
| 1 | True |
|
|
|
133 |
# Fail grade.
|
|
|
134 |
And user "student1" has attempted "Activity sample 2" with responses:
|
|
|
135 |
| slot | response |
|
|
|
136 |
| 1 | False |
|
|
|
137 |
# After receiving a grade, the completion criteria dropdown should display "Done" only for the passing grade.
|
|
|
138 |
And I am on the "Course 1" course page
|
|
|
139 |
And "To do" "button" should not exist in the "Activity sample 1" "activity"
|
|
|
140 |
And the "Receive a grade" item should exist in the "Done" dropdown of the "Activity sample 1" "activity"
|
|
|
141 |
But "To do" "button" should exist in the "Activity sample 2" "activity"
|
|
|
142 |
And the "Receive a grade" item should exist in the "To do" dropdown of the "Activity sample 2" "activity"
|
|
|
143 |
|
|
|
144 |
Scenario: Teacher can edit activity completion using completion dialog link
|
|
|
145 |
Given the following "activity" exists:
|
|
|
146 |
| activity | assign |
|
|
|
147 |
| name | Activity sample |
|
|
|
148 |
| course | C1 |
|
|
|
149 |
| completion | 2 |
|
|
|
150 |
| completionview | 1 |
|
|
|
151 |
When I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
152 |
# Edit conditions link should not be displayed when editing mode is off.
|
|
|
153 |
Then "Edit conditions" "link" should not exist in the "Activity sample" "core_courseformat > Activity completion"
|
|
|
154 |
# Edit conditions link should be displayed when editing mode is on.
|
|
|
155 |
But I am on "C1" course homepage with editing mode on
|
|
|
156 |
And I click on "Edit conditions" "link" in the "Activity sample" "core_courseformat > Activity completion"
|
|
|
157 |
And I should see "Activity sample" in the "page-header" "region"
|
|
|
158 |
And I should see "Edit settings"
|
|
|
159 |
And I should see "Activity completion"
|
|
|
160 |
|
|
|
161 |
Scenario: Completion dialog shows warning message if there are no criterias
|
|
|
162 |
# Create an activity with automatic completion but without completion criterias.
|
|
|
163 |
Given the following "activity" exists:
|
|
|
164 |
| activity | assign |
|
|
|
165 |
| name | Activity sample |
|
|
|
166 |
| course | C1 |
|
|
|
167 |
| completion | 2 |
|
|
|
168 |
# Teacher view.
|
|
|
169 |
When I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
170 |
And I turn editing mode on
|
|
|
171 |
And "You have to add at least one completion condition." "text" should exist in the "Activity sample" "core_courseformat > Activity completion"
|
|
|
172 |
And "Add conditions" "link" should exist in the "Activity sample" "core_courseformat > Activity completion"
|
|
|
173 |
And I log out
|
|
|
174 |
# Student view.
|
|
|
175 |
And I am on the "C1" "Course" page logged in as "student1"
|
|
|
176 |
And "There are no completion conditions set for this activity." "text" should exist in the "Activity sample" "core_courseformat > Activity completion"
|