Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@core @core_grades @javascript
2
Feature: Asynchronous regrade on a large course
3
 
4
  Background:
5
    Given the following "courses" exist:
6
      | shortname | fullname      | idnumber |
7
      | C1        | Test course 1 | C1       |
8
      | C2        | Test course 2 | C2       |
9
    And the following "users" exist:
10
      | username  |
11
      | teacher1  |
12
    And the following "course enrolments" exist:
13
      | user      | course | role           |
14
      | teacher1  | C1     | editingteacher |
15
      | teacher1  | C2     | editingteacher |
16
    And "100" "users" exist with the following data:
17
      | username  | student[count]             |
18
      | firstname | Student                    |
19
      | lastname  | [count]                    |
20
      | email     | student[count]@example.com |
21
    And "100" "course enrolments" exist with the following data:
22
      | user   | student[count] |
23
      | course | C1             |
24
      | role   | student        |
25
    And the following "activity" exists:
26
      | activity | assign                  |
27
      | course   | C1                      |
28
      | idnumber | a1                      |
29
      | name     | Test assignment 1       |
30
      | grade    | 100                     |
31
      | intro    | Submit your online text |
32
    And "100" "grade grades" exist with the following data:
33
      | gradeitem | Test assignment 1 |
34
      | user      | student[count]    |
35
      | grade     | 80.00             |
36
    And the following "course enrolment" exists:
37
      | user   | student1 |
38
      | course | C2       |
39
      | role   | student  |
40
    And the following "activity" exists:
41
      | activity | assign                  |
42
      | course   | C2                      |
43
      | idnumber | a2                      |
44
      | name     | Test assignment 2       |
45
      | grade    | 100                     |
46
      | intro    | Submit your online text |
47
    And the following "grade grade" exists:
48
      | gradeitem | Test assignment 2 |
49
      | user      | student1          |
50
      | grade     | 80.00             |
51
    And I am on the "Test assignment 1" "assign activity editing" page logged in as teacher1
52
    And I expand all fieldsets
53
    And I set the field "Rescale existing grades" to "Yes"
54
    And I set the field "Maximum grade" to "50"
55
    And I press "Save and return to course"
56
    And I log out
57
    And I change the viewport size to "medium"
58
 
59
  Scenario Outline: Task indicator displays on all grade reports when a calculation is pending
60
    Given I am on the "Test course 2" "<report>" page logged in as "<user>"
61
    Then I should not see "The report will update automatically. You don't need to do anything."
62
    And <element> should exist
63
    When I am on the "Test course 1" "<report>" page logged in as "<user>"
64
    Then I should see "The report will update automatically. You don't need to do anything."
65
    And <element> should not exist
66
 
67
    Examples:
68
      | report                          | element                                             | user     |
69
      | grades > Grader report > View   | "user-grades" "table"                               | teacher1 |
70
      | grades > Overview report > View | "overview-grade" "table"                            | teacher1 |
71
      | grades > Single view > View     | "Search for a user to view all their grades" "text" | teacher1 |
72
      | grades > Grade summary > View   | "Summary" "table"                                   | teacher1 |
73
      | grades > User report > View     | "Search for a user to view their report" "text"     | teacher1 |
74
      | grades > User report > View     | "table.user-grade" "css_element"                    | student1 |
75
 
76
  Scenario Outline: Gradebook settings can be accessed when a regrade is pending
77
    Given I am on the "Test course 2" "<page>" page logged in as "teacher1"
78
    Then I should see "<text>"
79
    And I should not see "The report will update automatically. You don't need to do anything."
80
    Given I am on the "Test course 1" "<page>" page logged in as "teacher1"
81
    Then I should see "<text>"
82
    And I should not see "The report will update automatically. You don't need to do anything."
83
 
84
    Examples:
85
      | page                           | text             |
86
      | grades > Gradebook setup       | Aggregation      |
87
      | grades > Course grade settings | General settings |
88
 
89
  Scenario: Task indicator displays on user profile grade reports when a grade calculation is pending
90
    Given I log in as "student1"
91
    When I follow "Grades" in the user menu
92
    And I follow "Test course 2"
93
    Then "table.user-grade" "css_element" should exist
94
    Then I should not see "The report will update automatically. You don't need to do anything."
95
    When I follow "Grades" in the user menu
96
    And I follow "Test course 1"
97
    Then "table.user-grade" "css_element" should not exist
98
    Then I should see "The report will update automatically. You don't need to do anything."
99
 
100
  Scenario: Task indicator progresses and redirects when the task is run.
101
    When I am on the "Test course 1" "grades > Grader report > View" page logged in as teacher1
102
    And I should see "The report will update automatically. You don't need to do anything."
103
    And I should not see "Run now"
104
    And I should not see "0.0%"
105
    And "user-grades" "table" should not exist
106
    And I run all adhoc tasks
107
    # Progress bar should update.
108
    And I wait until "Recalculating grades" "text" exists
109
    And I should see "100%"
110
    # The page should reload after a short delay.
111
    Then I wait until "Recalculating grades" "text" does not exist
112
    And I set the field "Search users" to "Student 1"
113
    And "user-grades" "table" should exist
114
    And "40.00" "text" should exist in the "student1@example.com" "table_row"
115
 
116
  Scenario: Admin should see a "Run now" button in the task indicator
117
    When I am on the "Test course 1" "grades > Grader report > View" page logged in as admin
118
    And I should see "The report will update automatically. You don't need to do anything."
119
    And I should not see "0.0%"
120
    And I should see "Run now"
121
 
122
  Scenario: Making changes on course with less than 100 grades performs the regrade synchronously, no indicator is shown.
123
    Given I am on the "Test assignment 2" "assign activity editing" page logged in as teacher1
124
    And I expand all fieldsets
125
    And I set the field "Rescale existing grades" to "Yes"
126
    And I set the field "Maximum grade" to "50"
127
    And I press "Save and return to course"
128
    When I am on the "Test course 2" "grades > Grader report > View" page
129
    Then I should not see "The report will update automatically. You don't need to do anything."
130
    And "user-grades" "table" should exist
131
 
132
  Scenario: Editing weights triggers a regrade, but further edits are possible
133
    Given I run all adhoc tasks
134
    And I am on the "Test course 1" "grades > Grader report > View" page logged in as "teacher1"
135
    And I should not see "The report will update automatically. You don't need to do anything."
136
    And I am on the "Test course 1" "grades > Gradebook setup" page
137
    When I set the field "Override weight of Test assignment 1" to "1"
138
    And I press "Save changes"
139
    And I am on the "Test course 1" "grades > Grader report > View" page
140
    And I should see "The report will update automatically. You don't need to do anything."
141
    And I am on the "Test course 1" "grades > Gradebook setup" page
142
    And I should not see "The report will update automatically. You don't need to do anything."