Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_grades @gradereport_singleview @javascript
2
Feature: We can use Single view
3
  As a teacher
4
  In order to view and edit grades
5
  For users and activities for a course.
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category |
10
      | Course 1 | C1        | 0        |
11
    And the following "users" exist:
12
      | username | firstname | lastname    | email                | idnumber | middlename | alternatename | firstnamephonetic | lastnamephonetic |
13
      | teacher1 | Teacher   | 1           | teacher1@example.com | t1       |            | fred          |                   |                  |
14
      | teacher2 | No edit   | 1           | teacher2@example.com | t2       |            | nick          |                   |                  |
15
      | teacher3 | Teacher   | 3           | teacher3@example.com | t3       |            | jack          |                   |                  |
16
      | student1 | Grainne   | Beauchamp   | student1@example.com | s1       | Ann        | Jill          | Gronya            | Beecham          |
17
      | student2 | Niamh     | Cholmondely | student2@example.com | s2       | Jane       | Nina          | Nee               | Chumlee          |
18
      | student3 | Siobhan   | Desforges   | student3@example.com | s3       | Sarah      | Sev           | Shevon            | De-forjay        |
19
      | student4 | Student   | 4           | student4@example.com | s4       |            | zac           |                   |                  |
20
    And the following "scales" exist:
21
      | name | scale |
22
      | Test Scale | Disappointing, Good, Very good, Excellent |
23
    And the following "grade items" exist:
24
      | itemname | course | gradetype | scale |
25
      | new grade item 1 | C1 | Scale | Test Scale |
26
    And the following "scales" exist:
27
      | name       | scale                                     |
28
      | Test Scale | Disappointing, Good, Very good, Excellent |
29
    And the following "course enrolments" exist:
30
      | user | course | role |
31
      | teacher1 | C1 | editingteacher |
32
      | teacher2 | C1 | teacher |
33
      | teacher3 | C1 | teacher |
34
      | student1 | C1 | student |
35
      | student2 | C1 | student |
36
      | student3 | C1 | student |
37
      | student4 | C1 | student |
38
    And the following "grade categories" exist:
39
      | fullname | course |
40
      | Sub category 1 | C1|
41
      | Sub category 2 | C1|
42
    And the following "activities" exist:
43
      | activity | course | idnumber | name | intro | grade |
44
      | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
45
      | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
46
      | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
47
      | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
48
    And the following "grade items" exist:
49
      | itemname | course | gradetype |
50
      | Test grade item | C1 | Scale |
51
    And the following "permission overrides" exist:
52
      | capability                  | permission | role     | contextlevel  | reference |
53
      | moodle/grade:edit           | Allow      | teacher  | Course        | C1        |
54
      | gradereport/singleview:view | Allow      | teacher  | Course        | C1        |
55
    And the following config values are set as admin:
56
      | fullnamedisplay | firstnamephonetic,lastnamephonetic |
57
      | alternativefullnameformat | middlename, alternatename, firstname, lastname |
58
    And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
59
 
60
  Scenario: I can update grades, add feedback and exclude grades.
61
    Given I navigate to "View > Single view" in the course gradebook
62
    And I click on "Users" "link" in the ".page-toggler" "css_element"
63
    And I click on "Student" in the "user" search widget
64
    And I turn editing mode on
65
    And I set the field "Override for Test assignment one" to "1"
66
    When I set the following fields to these values:
67
        | Grade for Test assignment one | 10.00 |
68
        | Feedback for Test assignment one | test data |
69
    And I set the field "Exclude for Test assignment four" to "1"
70
    And I press "Save"
71
    Then I should see "Grades were set for 2 items"
72
    And the field "Exclude for Test assignment four" matches value "1"
73
    And the field "Grade for Test assignment one" matches value "10.00"
74
    And I set the following fields to these values:
75
        | Test grade item | 45 |
76
    And I press "Save"
77
    Then I should see "Grades were set for 1 items"
78
    And the field "Grade for Test grade item" matches value "45.00"
79
    And the field "Grade for Course total" matches value "55.00"
80
    And I open the action menu in "Test assignment three" "table_row"
81
    And I choose "Show all grades" in the open action menu
82
    And I click on "Override for Ann, Jill, Grainne, Beauchamp" "checkbox"
83
    And I set the following fields to these values:
84
        | Grade for Ann, Jill, Grainne, Beauchamp | 12.05 |
85
        | Feedback for Ann, Jill, Grainne, Beauchamp | test data2 |
86
    And I set the field "Exclude for Jane, Nina, Niamh, Cholmondely" to "1"
87
    And I press "Save"
88
    Then I should see "Grades were set for 2 items"
89
    And the field "Grade for Ann, Jill, Grainne, Beauchamp" matches value "12.05"
90
    And the field "Exclude for Jane, Nina, Niamh, Cholmondely" matches value "1"
91
    And I click on "new grade item 1" in the "grade" search widget
92
    And I set the field "Grade for Ann, Jill, Grainne, Beauchamp" to "Very good"
93
    And I press "Save"
94
    Then I should see "Grades were set for 1 items"
95
    And the following should exist in the "generaltable" table:
96
        | First name (Alternate name) Last name | Grade |
97
        | Ann, Jill, Grainne, Beauchamp | Very good |
98
    And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher2"
99
    And I click on "Users" "link" in the ".page-toggler" "css_element"
100
    And I click on "Student" in the "user" search widget
101
    And I turn editing mode on
102
    And the "Exclude for Test assignment one" "checkbox" should be disabled
103
    And the "Override for Test assignment one" "checkbox" should be enabled
104
 
105
  Scenario: Single view links work on grade report.
106
    Given I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
107
    And I choose "Single view for this item" in the open action menu
108
    And I should see "Test assignment one"
109
    When I navigate to "View > Grader report" in the course gradebook
110
    And I click on user menu "Grainne Beauchamp"
111
    And I choose "Single view for this user" in the open action menu
112
    Then I should see "Gronya,Beecham"
113
 
114
  Scenario: I can bulk update grades.
115
    Given I click on user menu "Grainne Beauchamp"
116
    And I choose "Single view for this user" in the open action menu
117
    And I should see "Gronya,Beecham"
118
    When I turn editing mode on
119
    And I click on "Actions" "link"
120
    And I click on "Bulk insert" "link"
121
    And I click on "I understand that my unsaved changes will be lost." "checkbox"
122
    And I click on "All grades" "radio"
123
    And I set the field "Insert new grade" to "1.0"
124
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
125
    Then I should see "Grades were set for 6 items"
126
 
127
  Scenario: I can bulk update grades with custom decimal separator
128
    Given the following "language customisations" exist:
129
      | component       | stringid | value |
130
      | core_langconfig | decsep   | #     |
131
    And I click on user menu "Grainne Beauchamp"
132
    And I choose "Single view for this user" in the open action menu
133
    And I should see "Gronya,Beecham"
134
    When I turn editing mode on
135
    And I click on "Actions" "link"
136
    And I click on "Bulk insert" "link"
137
    And I click on "I understand that my unsaved changes will be lost." "checkbox"
138
    And I click on "All grades" "radio"
139
    And I set the field "Insert new grade" to "1#25"
140
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
141
    Then I should see "Grades were set for 6 items"
142
    # Custom scale, cast to int
143
    And the field "Grade for new grade item 1" matches value "Disappointing"
144
    # Value grade, float with custom decsep.
145
    And the field "Grade for Test assignment one" matches value "1#25"
146
    # Numerical scale, cast to int, showing as float with custom decsep.
147
    And the field "Grade for Test grade item" matches value "1#00"
148
 
149
  Scenario: Navigation works in the Single view.
150
    Given I click on user menu "Grainne Beauchamp"
151
    And I choose "Single view for this user" in the open action menu
152
    Then I should see "Gronya,Beecham"
153
    And I click on "Nee,Chumlee" "link" in the ".stickyfooter" "css_element"
154
    Then I should see "Nee,Chumlee"
155
    And I click on "Gronya,Beecham" "link" in the ".stickyfooter" "css_element"
156
    Then I should see "Gronya,Beecham"
157
    And I open the action menu in "Test assignment four" "table_row"
158
    And I choose "Show all grades" in the open action menu
159
    Then I should see "Test assignment four"
160
    And I click on "Test assignment three" in the "grade" search widget
161
    Then I should see "Test assignment three"
162
    And I click on "Test assignment four" in the "grade" search widget
163
    Then I should see "Test assignment four"
164
 
165
  Scenario: Activities are clickable only when it has a valid activity page.
166
    Given I click on user menu "Grainne Beauchamp"
167
    And I choose "Single view for this user" in the open action menu
168
    And "new grade item 1" "link" should not exist in the "//tbody//tr[position()=1]//td[position()=2]" "xpath_element"
169
    Then "Category total" "link" should not exist in the "//tbody//tr[position()=2]//td[position()=2]" "xpath_element"
170
    And "Course total" "link" should not exist in the "//tbody//tr[position()=last()]//td[position()=2]" "xpath_element"
171
 
172
  Scenario: Teacher sees his last viewed singleview report type when navigating back to the gradebook singleview report.
173
    Given I navigate to "View > Single view" in the course gradebook
174
    And I should see "Search for a user to view all their grades" in the "region-main" "region"
175
    And I click on "Grade items" "link"
176
    And I should see "Select a grade item above" in the "region-main" "region"
177
    When I am on the "Course 1" "grades > Single view > View" page
178
    Then I should see "Select a grade item above" in the "region-main" "region"
179
    And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher3"
180
    And I should see "Search for a user to view all their grades" in the "region-main" "region"
181
 
182
  Scenario: Teacher sees his last viewed user report when navigating back to the gradebook singleview report.
183
    Given I navigate to "View > Single view" in the course gradebook
184
    And I click on "Gronya,Beecham" in the "user" search widget
185
    And I should see "Gronya,Beecham" in the "region-main" "region"
186
    When I am on the "Course 1" "grades > Single view > View" page
187
    Then I should not see "Search for a user to view all their grades" in the "region-main" "region"
188
    And I should see "Gronya,Beecham" in the "region-main" "region"
189
    And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher3"
190
    And I should see "Search for a user to view all their grades" in the "region-main" "region"
191
 
192
  Scenario: Teacher sees his last viewed grade item report when navigating back to the gradebook singleview report.
193
    Given I navigate to "View > Single view" in the course gradebook
194
    And I click on "Grade items" "link"
195
    And I click on "Test assignment one" in the "grade" search widget
196
    And I should see "Test assignment one" in the "region-main" "region"
197
    When I am on the "Course 1" "grades > Single view > View" page
198
    Then I should not see "Select a grade item above" in the "region-main" "region"
199
    And I should see "Test assignment one" in the "region-main" "region"
200
    And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher3"
201
    And I should see "Search for a user to view all their grades" in the "region-main" "region"
202
 
203
  Scenario: Teacher sees his last viewed user report if the user is a part of the the current group.
204
    Given the following "groups" exist:
205
      | name    | course | idnumber | participation |
206
      | Group 1 | C1     | G1       | 1             |
207
    And the following "group members" exist:
208
      | user     | group |
209
      | student2 | G1    |
210
    And I am on the "Course 1" "course editing" page
211
    And I expand all fieldsets
212
    And I set the field "Group mode" to "Visible groups"
213
    And I press "Save and display"
214
    And I navigate to "View > Single view" in the course gradebook
215
    And I click on "Nee,Chumlee" in the "user" search widget
216
    And I navigate to "View > Grader report" in the course gradebook
217
    And I click on "Group 1" in the "group" search widget
218
    When I navigate to "View > Single view" in the course gradebook
219
    Then I should see "Nee,Chumlee" in the "region-main" "region"
220
    And I should not see "Search for a user to view all their grades" in the "region-main" "region"
221
 
222
  Scenario: Teacher does not see his last viewed user report if the user is not a part of the the current group.
223
    Given the following "groups" exist:
224
      | name    | course | idnumber | participation |
225
      | Group 1 | C1     | G1       | 1             |
226
    And the following "group members" exist:
227
      | user     | group |
228
      | student2 | G1    |
229
    And I am on the "Course 1" "course editing" page
230
    And I expand all fieldsets
231
    And I set the field "Group mode" to "Visible groups"
232
    And I press "Save and display"
233
    And I navigate to "View > Single view" in the course gradebook
234
    And I click on "Gronya,Beecham" in the "user" search widget
235
    And I navigate to "View > Grader report" in the course gradebook
236
    And I click on "Group 1" in the "group" search widget
237
    When I navigate to "View > Single view" in the course gradebook
238
    Then I should see "Search for a user to view all their grades" in the "region-main" "region"
239
    And I should not see "Gronya,Beecham" in the "region-main" "region"
240
 
241
  Scenario: Teacher does not see his last viewed user report if that user is no longer enrolled in the course.
242
    Given I navigate to "View > Single view" in the course gradebook
243
    And I click on "Gronya,Beecham" in the "user" search widget
244
    And I navigate to course participants
245
    And I click on "Unenrol" "icon" in the "Gronya,Beecham" "table_row"
246
    And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
247
    When I am on the "Course 1" "grades > Single view > View" page
248
    Then I should see "Search for a user to view all their grades" in the "region-main" "region"
249
    And I should not see "Gronya,Beecham" in the "region-main" "region"
250
 
251
  Scenario: Teacher does not see his last viewed grade item report if the item no longer exists in the course.
252
    Given I navigate to "View > Single view" in the course gradebook
253
    And I click on "Grade items" "link"
254
    And I click on "Test assignment four" in the "grade" search widget
255
    And I am on "Course 1" course homepage with editing mode on
256
    And I delete "Test assignment four" activity
257
    And I run all adhoc tasks
258
    When I navigate to "View > Single view" in the course gradebook
259
    Then I should see "Select a grade item above" in the "region-main" "region"
260
    And I should not see "Test grade item" in the "region-main" "region"