Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@gradereport @gradereport_grader
2
Feature: We don't show hidden grades for users without the 'moodle/grade:viewhidden' capability on grader report
3
  In order to show grader report in secure way
4
  As a teacher without the 'moodle/grade:viewhidden' capability
5
  I should not see hidden grades in the grader report
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | format |
10
      | Course 1 | C1        | topics |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email                |
13
      | teacher1 | Teacher   | 1        | teacher1@example.com |
14
      | student1 | Student   | 1        | student1@example.com |
15
      | student2 | Student   | 2        | student2@example.com |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher1 | C1     | editingteacher |
19
      | student1 | C1     | student        |
20
      | student2 | C1     | student        |
21
    And the following "activities" exist:
22
      | activity | course | section | name                   | intro                   | assignsubmission_onlinetext_enabled | submissiondrafts |
23
      | assign   | C1     | 1       | Test assignment name 1 | Submit your online text | 1                                   | 0                |
24
      | assign   | C1     | 1       | Test assignment name 2 | submit your online text | 1                                   | 0                |
25
      | assign   | C1     | 1       | Test assignment name 3 | submit your online text | 1                                   | 0                |
26
    # Hidden manual grade item.
27
    And the following "grade items" exist:
28
      | itemname     | grademin | grademax | course | hidden |
29
      | Manual grade | 20       | 40       | C1     | 1      |
30
    And the following "grade grades" exist:
31
      | gradeitem              | user     | grade |
32
      | Test assignment name 1 | student1 | 80    |
33
      | Test assignment name 1 | student2 | 70    |
34
      | Test assignment name 2 | student1 | 90    |
35
      | Test assignment name 2 | student2 | 60    |
36
      | Test assignment name 3 | student1 | 10    |
37
      | Test assignment name 3 | student2 | 50    |
38
      | Manual grade           | student1 | 30    |
39
      | Manual grade           | student2 | 40    |
40
    And I log in as "admin"
41
    And I am on "Course 1" course homepage with editing mode on
42
    # Hide assignment 2 activity.
43
    And I open "Test assignment name 2" actions menu
44
    And I choose "Hide" in the open action menu
45
    And I navigate to "View > Grader report" in the course gradebook
46
    # Hide grade.
47
    And I click on grade menu "Test assignment name 1" for user "student1"
48
    And I choose "Hide" in the open action menu
49
    # Hide assignment 3 grade item.
50
    And I set the following settings for grade item "Test assignment name 3" of type "gradeitem" on "grader" page:
51
      | Hidden          | 1 |
52
 
53
  @javascript
54
  Scenario: View grader report containing hidden activities or grade items or grades
55
    Given I log in as "teacher1"
56
    And I am on "Course 1" course homepage
57
    And I navigate to "View > Grader report" in the course gradebook
58
    And the following should exist in the "user-grades" table:
59
      | -1-                | -2-                  | -3-       | -4-       | -5-       | -6-       | -7-       |
60
      | Student 1          | student1@example.com | 80        | 90        | 10        | 30        | 210       |
61
      | Student 2          | student2@example.com | 70        | 60        | 50        | 40        | 220       |
62
    And I turn editing mode on
63
 
64
    And the field "Student 1 Test assignment name 1 grade" matches value "80"
65
    And the field "Student 1 Test assignment name 2 grade" matches value "90"
66
    And the field "Student 1 Test assignment name 3 grade" matches value "10"
67
    And the field "Student 1 Manual grade" matches value "30"
68
    And the field "Student 1 Course total grade" matches value "210"
69
    And "Hidden" "icon" should exist in the "Student 1" "table_row"
70
 
71
    And the field "Student 2 Test assignment name 1 grade" matches value "70"
72
    And the field "Student 2 Test assignment name 2 grade" matches value "60"
73
    And the field "Student 2 Test assignment name 3 grade" matches value "50"
74
    And the field "Student 2 Manual grade" matches value "40"
75
    And the field "Student 2 Course total grade" matches value "220"
76
    And "Hidden" "icon" should exist in the "Student 2" "table_row"
77
 
78
    # Remove the capability to see hidden grades.
79
    When the following "role capability" exists:
80
      | role                    | editingteacher  |
81
      | moodle/grade:viewhidden | prohibit        |
82
    And I navigate to "View > Grader report" in the course gradebook
83
    And I turn editing mode off
84
    And the following should exist in the "user-grades" table:
85
      | -1-                | -2-                  | -3-       | -4-       | -5-       | -6-       | -7-       |
86
      | Student 1          | student1@example.com | -         | -         | -         | -         | -         |
87
      | Student 2          | student2@example.com | 70        | -         | -         | -         | 70        |
88
    And "Hidden" "icon" should not exist in the "Student 1" "table_row"
89
    And "Hidden" "icon" should not exist in the "Student 2" "table_row"
90
    And I turn editing mode on
91
    And the following should exist in the "user-grades" table:
92
      | -1-                | -2-                  | -3-       | -4-       | -5-       | -6-       |
93
      | Student 1          | student1@example.com | -         | -         | -         | -         |
94
    And the following should exist in the "user-grades" table:
95
      | -1-                | -2-                  |  -4-       | -5-       | -6-       |
96
      | Student 2          | student2@example.com |  -         | -         | -         |
97
    # Check how totals should behave!!!!!!!!!!!
98
    And the field "Student 1 Course total grade" matches value ""
99
    And the field "Student 2 Test assignment name 1 grade" matches value "70"
100
    And the field "Student 2 Course total grade" matches value "70"
101
    And "Hidden" "icon" should not exist in the "Student 1" "table_row"
102
    Then "Hidden" "icon" should not exist in the "Student 2" "table_row"