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
@gradereport @gradereport_history @_bug_phantomjs
2
Feature: A teacher checks the grade history report in a course
3
  In order to check the history of the grades
4
  As a teacher
5
  I need to check that the history report is correctly displaying changes
6
 
7
  @javascript
8
  Scenario: Check the history report displays results correctly
9
    Given the following "courses" exist:
10
      | fullname | shortname | category | groupmode |
11
      | Course 1 | C1        | 0        | 1         |
12
    And the following "custom profile fields" exist:
13
      | datatype | shortname  | name           |
14
      | text     | food       | Favourite food |
15
    And the following "users" exist:
16
      | username | firstname | lastname | email                | profile_field_food |
17
      | teacher1 | Teacher   | 1        | teacher1@example.com |                    |
18
      | teacher2 | Teacher   | 2        | teacher2@example.com |                    |
19
      | student1 | Student   | 1        | student1@example.com | apple              |
20
      | student2 | Student   | 2        | student2@example.com | orange             |
21
    And the following "course enrolments" exist:
22
      | user     | course | role           |
23
      | teacher1 | C1     | editingteacher |
24
      | teacher2 | C1     | editingteacher |
25
      | student1 | C1     | student        |
26
      | student2 | C1     | student        |
27
    And the following "activities" exist:
28
      | activity | course | name                         |
29
      | assign   | C1     | The greatest assignment ever |
30
      | assign   | C1     | Rewarding assignment         |
31
    Given the following config values are set as admin:
32
      | showuseridentity | email,profile_field_food |
33
    And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
34
    And I should see "apple" in the "student1" "table_row"
35
    And I should see "orange" in the "student2" "table_row"
36
    And I turn editing mode on
37
    And I give the grade "50.00" to the user "Student 1" for the grade item "The greatest assignment ever"
38
    And I give the grade "60.00" to the user "Student 1" for the grade item "Rewarding assignment"
39
    And I give the grade "50.00" to the user "Student 2" for the grade item "The greatest assignment ever"
40
    And I give the grade "60.00" to the user "Student 2" for the grade item "Rewarding assignment"
41
    And I press "Save changes"
42
    And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher2"
43
    And I should see "apple" in the "student1" "table_row"
44
    And I should see "orange" in the "student2" "table_row"
45
    And I turn editing mode on
46
    And I give the grade "70.00" to the user "Student 1" for the grade item "The greatest assignment ever"
47
    And I give the grade "80.00" to the user "Student 1" for the grade item "Rewarding assignment"
48
    And I give the grade "70.00" to the user "Student 2" for the grade item "The greatest assignment ever"
49
    And I give the grade "80.00" to the user "Student 2" for the grade item "Rewarding assignment"
50
    And I press "Save changes"
51
    And I navigate to "View > Grade history" in the course gradebook
52
    When I press "Submit"
53
    Then the following should exist in the "gradereport_history" table:
54
      | First name/Last name | Email address        | Favourite food | Grade item                   | Original grade | Revised grade | Grader    |
55
      | Student 1          | student1@example.com | apple          | The greatest assignment ever |                | 50.00         | Teacher 1 |
56
      | Student 1          | student1@example.com | apple          | Rewarding assignment         |                | 60.00         | Teacher 1 |
57
      | Student 2          | student2@example.com | orange         | The greatest assignment ever |                | 50.00         | Teacher 1 |
58
      | Student 2          | student2@example.com | orange         | Rewarding assignment         |                | 60.00         | Teacher 1 |
59
      | Student 1          | student1@example.com | apple          | The greatest assignment ever | 50.00          | 70.00         | Teacher 2 |
60
      | Student 1          | student1@example.com | apple          | Rewarding assignment         | 60.00          | 80.00         | Teacher 2 |
61
      | Student 2          | student2@example.com | orange         | The greatest assignment ever | 50.00          | 70.00         | Teacher 2 |
62
      | Student 2          | student2@example.com | orange         | Rewarding assignment         | 60.00          | 80.00         | Teacher 2 |
63
    # Test filtering by student - display of several users.
64
    And I press "Select users"
65
    And I click on "Student 1" "checkbox"
66
    And I click on "Student 2" "checkbox"
67
    And I press "Finish selecting users"
68
    And I should see "Student 1, Student 2"
69
    And I press "Submit"
70
    And I should see "Student 1, Student 2"
71
    # Test filtering by student.
72
    And I press "Select users"
73
    And I set the field with xpath "//form/input[@class='usp-search-field']" to "Student 2"
74
    And I click on "Search" "button" in the "Select users" "dialogue"
75
    And I should see "Student 2" in the "Select users" "dialogue"
76
    And I should not see "Student 1" in the "Select users" "dialogue"
77
    # Deselect.
78
    And I click on "Student 2" "checkbox"
79
    And I press "Finish selecting users"
80
    And I press "Submit"
81
    And the following should exist in the "gradereport_history" table:
82
      | First name/Last name | Grade item                    | Original grade | Revised grade | Grader    |
83
      | Student 1          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
84
      | Student 1          | Rewarding assignment          |                | 60.00         | Teacher 1 |
85
      | Student 1          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
86
      | Student 1          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
87
    # Test for seeing custom fields contents in the rows.
88
    And I should see "apple" in the "student1" "table_row"
89
    And I should not see "orange"
90
    And the following should not exist in the "gradereport_history" table:
91
      | Student 2          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
92
      | Student 2          | Rewarding assignment          |                | 60.00         | Teacher 1 |
93
      | Student 2          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
94
      | Student 2          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
95
    # Test filtering by assignment.
96
    And I set the field "Grade item" to "The greatest assignment ever"
97
    And I press "Submit"
98
    And the following should exist in the "gradereport_history" table:
99
      | First name/Last name | Grade item                    | Original grade | Revised grade | Grader    |
100
      | Student 1          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
101
      | Student 1          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
102
    And the following should not exist in the "gradereport_history" table:
103
      | Student 1          | Rewarding assignment          |                | 60.00         | Teacher 1 |
104
      | Student 1          | Rewarding assignment          | 60.00          | 80.00         | Teacher 2 |
105
    # Test filtering by grader.
106
    And I set the field "Grader" to "Teacher 1"
107
    And I press "Submit"
108
    And the following should exist in the "gradereport_history" table:
109
      | First name/Last name | Email address        | Favourite food | Grade item                    | Original grade | Revised grade | Grader    |
110
      | Student 1          | student1@example.com | apple          | The greatest assignment ever  |                | 50.00         | Teacher 1 |
111
    And the following should not exist in the "gradereport_history" table:
112
      | Student 1          | The greatest assignment ever  | 50.00          | 70.00         | Teacher 2 |
113
    # Test filtering by revised grades.
114
    And I click on "id_revisedonly" "checkbox"
115
    And I press "Submit"
116
    And the following should exist in the "gradereport_history" table:
117
      | First name/Last name | Email address        | Favourite food | Grade item                    | Original grade | Revised grade | Grader    |
118
      | Student 1          | student1@example.com | apple          | The greatest assignment ever  |                | 50.00         | Teacher 1 |