Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@core @core_course
2
Feature: Users can access the course activities overview page
3
  In order to access the course activities overview page
4
  As a user
5
  I should be able to navigate to the course activities overview page
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
      | fullname | shortname | format | numsections | initsections | enablecompletion |
14
      | Course 1 | C1        | topics | 2           | 1            | 1                |
15
    And the following "course enrolments" exist:
16
      | user               | course | role           |
17
      | teacher1           | C1     | editingteacher |
18
      | student1           | C1     | student        |
19
    And the following "activities" exist:
20
      | activity | course | section | idnumber | name                 |
21
      | assign   | C1     | 1       | 1        | Test assignment name |
22
 
23
  Scenario: Teacher can navigate to the course overview page
24
    Given I am on the "C1" "Course" page logged in as "teacher1"
25
    When I follow "Activities"
26
    Then I should see "Activities"
27
    And I should see "An overview of all activities in the course" in the "region-main" "region"
28
    And I should see "Assignments" in the "region-main" "region"
29
 
30
  Scenario: Student can navigate to the course overview page
31
    Given I am on the "C1" "Course" page logged in as "student1"
32
    When I follow "Activities"
33
    Then I should see "Activities"
34
    And I should see "An overview of all activities in the course" in the "region-main" "region"
35
    And I should see "Assignments" in the "region-main" "region"
36
 
37
  Scenario: The activities overview shows only the type of activities present in the course
38
    Given the following "activities" exist:
39
      | activity | course | section | idnumber | name             | visible |
40
      | forum    | C1     | 1       | 1        | Test forum name  | 1       |
41
      | choice   | C1     | 1       | 2        | Test choice name | 0       |
42
    # Teacher can see all activities.
43
    When I am on the "Course 1" "course > activities" page logged in as "teacher1"
44
    And I should see "Assignments" in the "region-main" "region"
45
    And I should see "Forums" in the "region-main" "region"
46
    And I should see "Choices" in the "region-main" "region"
47
    And I should not see "Databases" in the "region-main" "region"
48
    And I should not see "Feedback" in the "region-main" "region"
49
    And I should not see "Glossaries" in the "region-main" "region"
50
    And I should not see "Lessons" in the "region-main" "region"
51
    And I should not see "External tools" in the "region-main" "region"
52
    And I should not see "Quizzes" in the "region-main" "region"
53
    And I should not see "SCORM packages" in the "region-main" "region"
54
    And I should not see "Wikis" in the "region-main" "region"
55
    And I should not see "Workshops" in the "region-main" "region"
56
    And I should not see "Resources" in the "region-main" "region"
57
    # Student can see only visible activities.
58
    And I am on the "Course 1" "course > activities" page logged in as "student1"
59
    And I should see "Assignments" in the "region-main" "region"
60
    And I should see "Forums" in the "region-main" "region"
61
    And I should not see "Choices" in the "region-main" "region"
62
    And I should not see "Databases" in the "region-main" "region"
63
    And I should not see "Feedback" in the "region-main" "region"
64
    And I should not see "Glossaries" in the "region-main" "region"
65
    And I should not see "Lessons" in the "region-main" "region"
66
    And I should not see "External tools" in the "region-main" "region"
67
    And I should not see "Quizzes" in the "region-main" "region"
68
    And I should not see "SCORM packages" in the "region-main" "region"
69
    And I should not see "Wikis" in the "region-main" "region"
70
    And I should not see "Workshops" in the "region-main" "region"
71
    And I should not see "Resources" in the "region-main" "region"
72
 
73
  @javascript
74
  Scenario: Teacher can expand and collapse course overview items
75
    # Create another activity to test each activity type could be expanded independently.
76
    Given the following "activities" exist:
77
      | activity | course | section | idnumber | name            |
78
      | forum    | C1     | 1       | 1        | Test forum name |
79
    And I am on the "Course 1" "course > activities" page logged in as "teacher1"
80
    And I should see "Assignments" in the "assign_overview_collapsible" "region"
81
    And I should see "Forums" in the "forum_overview_collapsible" "region"
82
    And I should not see "Test assignment name" in the "assign_overview_collapsible" "region"
83
    And I should not see "Forum overview" in the "forum_overview_collapsible" "region"
84
    When I click on "Expand" "link" in the "assign_overview_collapsible" "region"
85
    Then I should see "Test assignment name" in the "assign_overview_collapsible" "region"
86
    And I should not see "Forum overview" in the "forum_overview_collapsible" "region"
87
    And I click on "Collapse" "link" in the "assign_overview_collapsible" "region"
88
    And I should not see "Test assignment name" in the "assign_overview_collapsible" "region"
89
    And I should not see "Forum overview" in the "forum_overview_collapsible" "region"
90
 
91
  Scenario: Course overview shows the course present activity types
92
    Given the following "activities" exist:
93
      | activity        | course | name        |
94
      | book            | C1     | Activity 2  |
95
      | choice          | C1     | Activity 3  |
96
      | data            | C1     | Activity 4  |
97
      | feedback        | C1     | Activity 5  |
98
      | folder          | C1     | Activity 6  |
99
      | forum           | C1     | Activity 7  |
100
      | glossary        | C1     | Activity 8  |
101
      | imscp           | C1     | Activity 10 |
102
      | label           | C1     | Activity 11 |
103
      | lesson          | C1     | Activity 12 |
104
      | lti             | C1     | Activity 13 |
105
      | page            | C1     | Activity 14 |
106
      | quiz            | C1     | Activity 15 |
107
      | resource        | C1     | Activity 16 |
108
      | scorm           | C1     | Activity 17 |
109
      | url             | C1     | Activity 18 |
110
      | wiki            | C1     | Activity 19 |
111
      | workshop        | C1     | Activity 20 |
112
    Given I am on the "Course 1" "course > activities" page logged in as "teacher1"
113
    And I should see "Assignments" in the "assign_overview_collapsible" "region"
114
    And I should see "Choices" in the "choice_overview_collapsible" "region"
115
    And I should see "Databases" in the "data_overview_collapsible" "region"
116
    And I should see "Feedback" in the "feedback_overview_collapsible" "region"
117
    And I should see "Forums" in the "forum_overview_collapsible" "region"
118
    And I should see "Glossaries" in the "glossary_overview_collapsible" "region"
119
    And I should see "Lessons" in the "lesson_overview_collapsible" "region"
120
    And I should see "External tools" in the "lti_overview_collapsible" "region"
121
    And I should see "Quizzes" in the "quiz_overview_collapsible" "region"
122
    And I should see "SCORM packages" in the "scorm_overview_collapsible" "region"
123
    And I should see "Wikis" in the "wiki_overview_collapsible" "region"
124
    And I should see "Workshops" in the "workshop_overview_collapsible" "region"
125
    # All resources are grouped.
126
    And I should see "Resources" in the "resource_overview_collapsible" "region"
127
 
128
  @javascript
129
  Scenario: The resources overview is loaded at the moment the section is expanded via Ajax
130
    Given the following "activities" exist:
131
      | activity | course | name       | completion | completionview |
132
      | book     | C1     | Activity 1 | 0          | 0              |
133
      | folder   | C1     | Activity 2 | 0          | 0              |
134
      | imscp    | C1     | Activity 3 | 0          | 0              |
135
    And I am on the "Course 1" "course > activities" page logged in as "teacher1"
136
    And "Activity 1" "link" should not exist in the "resource_overview_collapsible" "region"
137
    And "Activity 2" "link" should not exist in the "resource_overview_collapsible" "region"
138
    And "Activity 3" "link" should not exist in the "resource_overview_collapsible" "region"
139
    When I click on "Expand" "link" in the "resource_overview_collapsible" "region"
140
    Then "Activity 1" "link" should exist in the "resource_overview_collapsible" "region"
141
    And "Activity 2" "link" should exist in the "resource_overview_collapsible" "region"
142
    And "Activity 3" "link" should exist in the "resource_overview_collapsible" "region"
143
 
144
  Scenario: Course overview shows a table with all resources
145
    Given the following "activities" exist:
146
      | activity        | course | name        |
147
      | book            | C1     | Activity 1  |
148
      | folder          | C1     | Activity 2  |
149
      | imscp           | C1     | Activity 3  |
150
      | page            | C1     | Activity 4  |
151
      | resource        | C1     | Activity 5  |
152
      | url             | C1     | Activity 6  |
153
    When I am on the "Course 1" "course > activities > resource" page logged in as "teacher1"
154
    Then I should see "Book" in the "Activity 1" "table_row"
155
    And I should see "Folder" in the "Activity 2" "table_row"
156
    And I should see "IMS content package" in the "Activity 3" "table_row"
157
    And I should see "Page" in the "Activity 4" "table_row"
158
    And I should see "File" in the "Activity 5" "table_row"
159
    And I should see "URL" in the "Activity 6" "table_row"
160
 
161
  @javascript
162
  Scenario: Students should see completion status in the overview when some activity has completion
163
    Given the following "activities" exist:
164
      | activity        | course | name        | completion | completionview |
165
      | book            | C1     | Activity 1  | 0          | 0              |
166
      | folder          | C1     | Activity 2  | 1          | 1              |
167
      | imscp           | C1     | Activity 3  | 1          | 1              |
168
    And I am on the "Course 1" "course" page logged in as "student1"
169
    And I toggle the manual completion state of "Activity 2"
170
    When I am on the "Course 1" "course > activities > resource" page
171
    Then I should see "-" in the "Activity 1" "table_row"
172
    And I should see "Done" in the "Activity 2" "table_row"
173
    And I should see "Mark as done" in the "Activity 3" "table_row"
174
 
175
  Scenario: Students should not see completion status in the overview if no activity has completion
176
    Given the following "activities" exist:
177
      | activity        | course | name        | completion | completionview |
178
      | book            | C1     | Activity 1  | 0          | 0              |
179
      | folder          | C1     | Activity 2  | 0          | 0              |
180
      | imscp           | C1     | Activity 3  | 0          | 0              |
181
    When I am on the "Course 1" "course > activities > resource" page logged in as "student1"
182
    Then I should not see "Completion status" in the "resource_overview_collapsible" "region"
183
 
184
  Scenario: The course overview name column informs about the activity and section
185
    Given the following "activities" exist:
186
      | activity | course | section | name       | content                    |
187
      | page     | C1     | 1       | Activity 1 | This is the page 1 content |
188
      | page     | C1     | 2       | Activity 2 | This is the page 2 content |
189
    And I am on the "Course 1" "course > activities > resource" page logged in as "teacher1"
190
    When I click on "Expand" "link" in the "resource_overview_collapsible" "region"
191
    Then I should see "Section 1" in the "Activity 1" "table_row"
192
    And I should see "Section 2" in the "Activity 2" "table_row"
193
    And I click on "Activity 1" "link" in the "Activity 1" "table_row"
194
    And I should see "This is the page 1 content"
195
 
196
  @javascript
197
  Scenario: Students can manage manual completions from the course overview
198
    Given the following "activities" exist:
199
      | activity | course | name       | completion | completionview |
200
      | folder   | C1     | Activity 1 | 1          | 1              |
201
    And I am on the "Course 1" "course > activities > resource" page logged in as "student1"
202
    And I should see "Mark as done" in the "Activity 1" "table_row"
203
    When I click on "Mark as done" "button" in the "Activity 1" "table_row"
204
    Then I should see "Done" in the "Activity 1" "table_row"
205
    And I click on "Done" "button" in the "Activity 1" "table_row"
206
    And I should see "Mark as done" in the "Activity 1" "table_row"
207
 
208
  Scenario: Students can see the automatic completion criterias in the course overview
209
    Given the following "activity" exists:
210
      | activity       | folder     |
211
      | name           | Activity 1 |
212
      | course         | C1         |
213
      | completion     | 2          |
214
      | completionview | 1          |
215
    When I am on the "Course 1" "course > activities > resource" page logged in as "student1"
216
    Then I should see "To do" in the "Activity 1" "table_row"
217
    And I should see "View" in the "Activity 1" "table_row"
218
 
219
  Scenario: The course overview page should log a page event and a reource list event
220
    Given the following "activity" exists:
221
      | activity       | folder     |
222
      | name           | Activity 1 |
223
      | course         | C1         |
224
    And I am on the "Course 1" "course > activities" page logged in as "teacher1"
225
    And I am on the "Course 1" "course > activities > resource" page logged in as "student1"
226
    When I am on the "Course 1" "course" page logged in as "teacher1"
227
    And I navigate to "Reports" in current page administration
228
    And I click on "Logs" "link"
229
    Then I set the field "Select a user" to "Teacher 1"
230
    And I click on "Get these logs" "button"
231
    And I should see "Course activities overview page viewed"
232
    And I should not see "viewed the list of resources"
233
    And I set the field "Select a user" to "Student 1"
234
    And I click on "Get these logs" "button"
235
    And I should see "Course activities overview page viewed"
236
    And I should see "viewed the list of resources"
237
 
238
  @javascript
239
  Scenario: The course overview page should log reource list event when loading the overview table
240
    Given the following "activity" exists:
241
      | activity | folder     |
242
      | name     | Activity 1 |
243
      | course   | C1         |
244
    And I am on the "Course 1" "course > activities" page logged in as "teacher1"
245
    And I click on "Expand" "link" in the "resource_overview_collapsible" "region"
246
    When I am on the "Course 1" "course" page logged in as "teacher1"
247
    And I navigate to "Reports" in current page administration
248
    And I click on "Logs" "link"
249
    And I set the field "Select a user" to "Teacher 1"
250
    And I click on "Get these logs" "button"
251
    Then I should see "Course activities overview page viewed"
252
    And I should see "viewed the list of resources"
253
 
254
  Scenario: Users can see a link to the old index when the activity does not provide overview information
255
    Given the following "activities" exist:
256
      | activity | course | name       |
257
      | wiki     | C1     | Activity 1 |
258
      | wiki     | C1     | Activity 2 |
259
      | assign   | C1     | Activity 3 |
260
    When I am on the "Course 1" "course > activities > wiki" page logged in as "student1"
261
    And I should see "Wiki overview"
262
    And I follow "Wiki overview"
263
    And I should see "Activity 1"
264
    And I should see "Activity 2"
265
    # Check activities with integration do not show the link.
266
    And I am on the "Course 1" "course > activities > assign" page
267
    And I should not see "Assignment overview"
268
 
269
  Scenario: Activities overview provide completion information to the student
270
    Given the following "activities" exist:
271
      | activity | course | name       | completion | completionview |
272
      | choice   | C1     | Activity 1 | 2          | 1              |
273
      | choice   | C1     | Activity 2 | 2          | 1              |
274
      | choice   | C1     | Activity 3 | 1          | 0              |
275
      | choice   | C1     | Activity 4 | 0          | 0              |
276
    And I am on the "Activity 1" "activity" page logged in as "student1"
277
    When I am on the "Course 1" "course > activities > choice" page logged in as "student1"
278
    Then I should see "Completion status" in the "choice_overview_collapsible" "region"
279
    And I should see "Done" in the "Activity 1" "table_row"
280
    And I should see "To do" in the "Activity 2" "table_row"
281
    And I should see "Mark as done" in the "Activity 3" "table_row"
282
    And I should see "-" in the "Activity 4" "table_row"
283
    And I am on the "Course 1" "course > activities > choice" page logged in as "teacher1"
284
    And I should not see "Completion status" in the "choice_overview_collapsible" "region"
285
    And I should not see "To do" in the "Activity 2" "table_row"
286
    And I should not see "Mark as done" in the "Activity 3" "table_row"
287
    And I should not see "-" in the "Activity 4" "table_row"
288
 
289
  Scenario: Activities overview provide grade information to the student
290
    Given the following "activities" exist:
291
      | activity | course | name       |
292
      | lesson   | C1     | Activity 1 |
293
      | lesson   | C1     | Activity 2 |
294
    And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
295
    And I turn editing mode on
296
    And I give the grade "42" to the user "Student 1" for the grade item "Activity 1"
297
    And I press "Save changes"
298
    When I am on the "Course 1" "course > activities > lesson" page logged in as "student1"
299
    Then I should see "Grade" in the "lesson_overview_collapsible" "region"
300
    And I should see "42.00" in the "Activity 1" "table_row"
301
    And I should see "-" in the "Activity 2" "table_row"
302
    When I am on the "Course 1" "course > activities > lesson" page logged in as "teacher1"
303
    And I should not see "Grade" in the "lesson_overview_collapsible" "region"
304
 
305
  Scenario: Activities name is properly filtered and rendered
306
    Given the following config values are set as admin:
307
      | formatstringstriptags | 0 |
308
    And the following "activity" exists:
309
      | activity  | assign                                                                                                             |
310
      | course    | C1                                                                                                                 |
311
      | section   | 1                                                                                                                  |
312
      | idnumber  | mathjax                                                                                                            |
313
      | name      | <span class="filter_mathjaxloader_equation">Announcements$$(a+b)=2$$<span class="nolink">$$(a+b)=2$$</span></span> |
314
    When I am on the "Course 1" "course > activities > assign" page logged in as "teacher1"
315
    Then I should not see "span" in the "assign_overview_collapsible" "region"
316
 
317
  Scenario: Not gradable activities don't show any Grade colum in the activity overview
318
#   Create an activity non-gradable from the creation.
319
    Given the following "activities" exist:
320
      | activity | name         | course | idnumber | grade |
321
      | assign   | Not gradable | C1     | assign2  | 0     |
322
    And I am on the "Test assignment name" "assign activity editing" page logged in as "teacher1"
323
    And I expand all fieldsets
324
#   Edit an activity to make it non-gradable.
325
    And I set the following fields to these values:
326
      | Feedback comments | 0    |
327
      | Annotate PDF      | 0    |
328
      | Grade > Type      | None |
329
    And I press "Save and return to course"
330
    And I am on the "Course 1" "course > activities > assign" page logged in as "student1"
331
    And I should not see "Grade" in the "assign_overview_collapsible" "region"
332
#   Edit an activity to add non-gradable feedback grading.
333
    And I am on the "Not gradable" "assign activity editing" page logged in as "teacher1"
334
    And I expand all fieldsets
335
    And I set the field "Feedback comments" to "1"
336
    And I press "Save and return to course"
337
    When I am on the "Course 1" "course > activities > assign" page logged in as "student1"
338
    Then I should not see "Grade" in the "assign_overview_collapsible" "region"
339
#   Edit an activity to add gradable grading.
340
    And I am on the "Not gradable" "assign activity editing" page logged in as "teacher1"
341
    And I expand all fieldsets
342
    And I set the field "Grade > Type" to "Point"
343
    And I press "Save and return to course"
344
    And I am on the "Course 1" "course > activities > assign" page logged in as "student1"
345
    And I should not see "-" in the "Test assignment name" "table_row"
346
    And I should see "-" in the "Not gradable" "table_row"