Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_completion @javascript
2
Feature: Allow teachers to edit the default activity completion rules in a course.
3
  In order to set the activity completion defaults for new activities
4
  As a teacher
5
  I need to be able to edit the completion rules for a group of activities.
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category | enablecompletion | numsections |
10
      | Course 1 | C1        | 0        | 1                | 1           |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email |
13
      | teacher1 | Teacher | First | teacher1@example.com |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
17
 
18
  # Given I am a teacher in a course with completion tracking enabled and activities present.
19
  # When I edit activity completion defaults for activity types.
20
  # Then the completion rule defaults should apply only to activities created from that point onwards.
21
  Scenario: Edit default activity completion rules for assignment
22
    Given the following "activity" exists:
23
      | activity   | assign               |
24
      | course     | C1                   |
25
      | name       | Test assignment one  |
26
      | completion | 0                    |
27
    And I am on the "Course 1" course page logged in as teacher1
28
    When I navigate to "Course completion" in current page administration
29
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
30
    And I click on "Expand Assignment" "button"
31
    And I set the following fields to these values:
32
      | id_completion_assign_2    | 1 |
33
      | completionview_assign     | 1 |
34
      | completionusegrade_assign | 1 |
35
      | completionsubmit_assign   | 1 |
36
    And I should not see "Cancel" in the "[data-region='activitycompletion-forum']" "css_element"
37
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
38
    Then I should see "Changes saved"
39
    And I navigate to "Course completion" in current page administration
40
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
41
    And I click on "Expand Assignment" "button"
42
    And I set the following fields to these values:
43
      | completionview_assign     | 0 |
44
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
45
    And I am on "Course 1" course homepage with editing mode on
1441 ariadna 46
    And I click on "Add content" "button" in the "New section" "section"
47
    And I click on "Activity or resource" "button" in the "New section" "section"
1 efrain 48
    And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
49
    And I expand all fieldsets
50
    # Completion tracking 2 = Add requirements.
51
    And the field "Add requirements" matches value "1"
52
    And the field "completionview" matches value "0"
53
    And the field "completionusegrade" matches value "1"
54
    And the field "completionsubmit" matches value "1"
55
    But I am on the "Test assignment one" Activity page
56
    And I navigate to "Settings" in current page administration
57
    And I expand all fieldsets
58
    # Completion tracking 0 = Do not indicate activity completion.
59
    And the field "None" matches value "1"
60
 
61
  Scenario: Edit default activity completion rules for forum
62
    Given the following "activity" exists:
63
      | activity | forum                |
64
      | course   | C1                   |
65
      | name     | Test forum one       |
66
      | completion | 0                    |
67
    And I am on the "Course 1" course page logged in as teacher1
68
    When I navigate to "Course completion" in current page administration
69
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
70
    And I click on "Expand Forum" "button"
71
    And I set the following fields to these values:
72
      # 2 = Add requeriments.
73
      | id_completion_forum_2           | 1 |
74
      | completionview_forum            | 0 |
75
      # 0 = Rating.
76
      | completionusegrade_forum        | 1 |
77
      | completiongradeitemnumber_forum | 0 |
78
      # 1 = Passing grade.
79
      | completionpassgrade_forum       | 1 |
80
      | completionpostsenabled_forum    | 1 |
81
      | completionposts_forum           | 2 |
82
      | completionrepliesenabled_forum  | 1 |
83
      | completionreplies_forum         | 3 |
84
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-forum']" "css_element"
85
    Then I should see "Changes saved"
86
    And I am on "Course 1" course homepage with editing mode on
1441 ariadna 87
    And I click on "Add content" "button" in the "New section" "section"
88
    And I click on "Activity or resource" "button" in the "New section" "section"
1 efrain 89
    And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
90
    And I expand all fieldsets
91
    # Completion tracking 2 = Add requirements.
92
    And the field "Add requirements" matches value "1"
93
    And the field "completionview" matches value "0"
94
    # Value 0 for completiongradeitemnumber is "Rating".
95
    And the field "completiongradeitemnumber" matches value "0"
96
    And the field "completionpassgrade" matches value "1"
97
    And the field "completionpostsenabled" matches value "1"
98
    And the field "completionposts" matches value "2"
99
    And the field "completionrepliesenabled" matches value "1"
100
    And the field "completionreplies" matches value "3"
101
    But I am on the "Test forum one" Activity page
102
    And I navigate to "Settings" in current page administration
103
    And I expand all fieldsets
104
    # None checked = Do not indicate activity completion.
105
    And the field "None" matches value "1"
106
 
107
  Scenario: Edit default activity completion rules for glossary
108
    Given the following "activity" exists:
109
      | activity   | glossary             |
110
      | course     | C1                   |
111
      | name       | Test glossary one    |
112
      | completion | 0                    |
113
    And I am on the "Course 1" course page logged in as teacher1
114
    When I navigate to "Course completion" in current page administration
115
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
116
    And I click on "Expand Glossary" "button"
117
    And I set the following fields to these values:
118
      # Add requirements = 2.
119
      | id_completion_glossary_2           | 1 |
120
      | completionview_glossary            | 0 |
121
      | completionusegrade_glossary        | 1 |
122
      | completionentriesenabled_glossary  | 1 |
123
      | completionentries_glossary         | 2 |
124
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-glossary']" "css_element"
125
    Then I should see "Changes saved"
126
    And I am on "Course 1" course homepage with editing mode on
1441 ariadna 127
    And I click on "Add content" "button" in the "New section" "section"
128
    And I click on "Activity or resource" "button" in the "New section" "section"
1 efrain 129
    And I click on "Add a new Glossary" "link" in the "Add an activity or resource" "dialogue"
130
    And I expand all fieldsets
131
    # Completion tracking 2 = Add requirements.
132
    And the field "Add requirements" matches value "1"
133
    And the field "completionview" matches value "0"
134
    And the field "completionusegrade" matches value "1"
135
    And the field "completionentriesenabled" matches value "1"
136
    And the field "completionentries" matches value "2"
137
    But I am on the "Test glossary one" Activity page
138
    And I navigate to "Settings" in current page administration
139
    And I expand all fieldsets
140
    # Completion tracking 0 = Do not indicate activity completion.
141
    And the field "None" matches value "1"
142
 
143
  Scenario: Edit default activity completion rules for several activities
144
    Given I am on the "Course 1" course page logged in as teacher1
145
    When I navigate to "Course completion" in current page administration
146
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
147
    And I click on "Expand Assignment" "button"
148
    And I set the following fields to these values:
149
      | id_completion_assign_2    | 1 |
150
      | completionview_assign     | 0 |
151
      | completionusegrade_assign | 0 |
152
      | completionsubmit_assign   | 1 |
153
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
154
    And I should see "Changes saved"
155
    And I click on "Expand Forum" "button"
156
    And I set the following fields to these values:
157
      | id_completion_forum_2              | 1 |
158
      | completionview_forum               | 0 |
159
      | completionpostsenabled_forum       | 1 |
160
      | completionposts_forum              | 3 |
161
      | completiondiscussionsenabled_forum | 0 |
162
      | completionrepliesenabled_forum     | 0 |
163
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-forum']" "css_element"
164
    And I should see "Changes saved"
165
    And I click on "Expand SCORM package" "button"
166
    And I set the following fields to these values:
167
      | id_completion_scorm_2              | 1 |
168
      | completionview_scorm               | 0 |
169
      | completionscoreenabled_scorm       | 1 |
170
      | completionscorerequired_scorm      | 3 |
171
      | completionstatusrequired_scorm[2]  | 1 |
172
      | completionstatusrequired_scorm[4]  | 0 |
173
      | completionstatusallscos_scorm      | 1 |
174
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
175
    And I should see "Changes saved"
176
    And I click on "Expand Book" "button"
177
    And I set the following fields to these values:
178
      | completion_book         | Do not indicate activity completion                 |
179
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-book']" "css_element"
180
    And I should see "Changes saved"
181
    And I click on "Expand Lesson" "button"
182
    And I set the following fields to these values:
183
    # Students must manually mark the activity as done = 1.
184
      | id_completion_lesson_1         | 1  |
185
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-lesson']" "css_element"
186
    And I should see "Changes saved"
187
    # Change current page and go back to "Default activity completion", to confirm the form values have been saved properly.
188
    And I set the field "Course completion tertiary navigation" to "Course completion settings"
189
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
190
    Then the field "id_completion_lesson_1" matches value "1"
191
    # Check that the rules for book, assignment and forum are still the same.
192
    And I click on "Expand Book" "button"
193
    And the field "id_completion_book_0" matches value "1"
194
    And I click on "Expand Assignment" "button"
195
    And the field "id_completion_assign_2" matches value "1"
196
    And the field "completionview_assign" matches value "0"
197
    And the field "completionusegrade_assign" matches value "0"
198
    And the field "completionsubmit_assign" matches value "1"
199
    And I click on "Expand Forum" "button"
200
    And the field "id_completion_forum_2" matches value "1"
201
    And the field "completionview_forum" matches value "0"
202
    And the field "completionpostsenabled_forum" matches value "1"
203
    And the field "completionposts_forum" matches value "3"
204
    And the field "completiondiscussionsenabled_forum" matches value "0"
205
    And the field "completionrepliesenabled_forum" matches value "0"
206
    And I click on "Expand SCORM package" "button"
207
    And the field "id_completion_scorm_2" matches value "1"
208
    And the field "completionview_scorm" matches value "0"
209
    And the field "completionscoreenabled_scorm" matches value "1"
210
    And the field "completionscorerequired_scorm" matches value "3"
211
    And the field "completionstatusrequired_scorm[2]" matches value "1"
212
    And the field "completionstatusrequired_scorm[4]" matches value "0"
213
    And the field "completionstatusallscos_scorm" matches value "1"
214
 
215
  Scenario: Edit default activity completion without rules for automatic completion
216
    Given I am on the "Course 1" course page logged in as teacher1
217
    When I navigate to "Course completion" in current page administration
218
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
219
    And I click on "Expand Assignment" "button"
220
    And I set the following fields to these values:
221
      | id_completion_assign_2    | 1 |
222
      | completionview_assign     | 0 |
223
      | completionusegrade_assign | 0 |
224
      | completionsubmit_assign   | 0 |
225
    And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
226
    Then I should see "You must select at least one condition"
227
    And I should not see "Changes saved"
228
 
229
  Scenario: Activities in Default activity completion are ordered alphabetically
230
    Given I am on the "Course 1" course page logged in as teacher1
231
    When I navigate to "Course completion" in current page administration
232
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
233
    Then "Quiz" "text" should appear before "Text and media area" "text"
234
 
235
  @accessibility
236
  Scenario: Evaluate the accessibility of the default activity completion page
237
    Given I am on the "Course 1" course page logged in as "teacher1"
238
    When I navigate to "Course completion" in current page administration
239
    And I set the field "Course completion tertiary navigation" to "Default activity completion"
240
    And the page should meet accessibility standards