Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_subcourse
2
Feature: Course final grades hidden in the referenced course are hidden in the target course, too.
3
  In order to not reveal the hidden grades to students
4
  As a teacher
5
  I need to be sure that grades hidden in the referenced course, are kept hidden when fetched into the subcourse activity
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
      | student2      | Student   | 2         | student2@example.com |
13
    And the following "courses" exist:
14
      | fullname      | shortname | category  |
15
      | MainCourse    | M         | 0         |
16
      | RefCourse     | R         | 0         |
17
    And the following "course enrolments" exist:
18
      | user          | course    | role              |
19
      | teacher1      | M         | editingteacher    |
20
      | student1      | M         | student           |
21
      | student2      | M         | student           |
22
      | teacher1      | R         | editingteacher    |
23
      | student1      | R         | student           |
24
      | student2      | R         | student           |
25
    #
26
    # Set grades in the referenced course.
27
    #
28
    And I log in as "teacher1"
29
    And I am on "RefCourse" course homepage
30
    And I navigate to "Setup > Gradebook setup" in the course gradebook
31
    And I press "Add grade item"
32
    And I set the following fields to these values:
33
      | Item name     | Manual item 1   |
34
      | Maximum grade | 10              |
35
    And I press "Save changes"
36
    And I navigate to "View > Grader report" in the course gradebook
37
    And I turn editing mode on
38
    And I give the grade "5" to the user "Student 1" for the grade item "Manual item 1"
39
    And I give the grade "8" to the user "Student 2" for the grade item "Manual item 1"
40
    And I press "Save"
41
    And I follow "Change to aggregates only"
42
    And I click on "Edit grade" "link" in the "Student 1" "table_row"
43
    And I set the following fields to these values:
44
      | Hidden  | 1 |
45
    And I press "Save changes"
46
    And I turn editing mode off
47
 
48
  @javascript
49
  Scenario: If the course final grade is hidden, the associated subcourse activity grade is marked as hidden, too.
50
    Given I am on "MainCourse" course homepage
51
    And I turn editing mode on
52
    And I add a "Subcourse" to section "1" and I fill the form with:
53
      | Subcourse name                    | Unit course 1       |
54
      | Fetch grades from                 | RefCourse (R)       |
55
      | Redirect to the referenced course | 0                   |
56
    And I turn editing mode off
57
    And I am on "MainCourse" course homepage
58
    And I am on the "Unit course 1" "subcourse activity" page logged in as teacher1
59
    When I follow "Fetch grades now"
60
    And I am on "MainCourse" course homepage
61
    And I navigate to "View > Grader report" in the course gradebook
62
    Then the following should exist in the "user-grades" table:
63
      | Email address         | -4-   |
64
      | student1@example.com  | 5.00  |
65
      | student2@example.com  | 8.00  |
66
    And I log out
67
    #
68
    # Student 1 should not see the grade in the referenced course.
69
    #
70
    And I log in as "student1"
71
    And I am on "MainCourse" course homepage
72
    And I navigate to "User report" in the course gradebook
73
    And I should see "MainCourse" in the "user-grade" "table"
74
    And I should not see "Unit course 1" in the "user-grade" "table"
75
    And I should not see "5.00" in the "user-grade" "table"
76
    And I log out
77
    #
78
    # Student 2 should see the grade normally.
79
    #
80
    And I log in as "student2"
81
    And I am on "MainCourse" course homepage
82
    And I navigate to "User report" in the course gradebook
83
    And I should see "MainCourse" in the "user-grade" "table"
84
    And I should see "Unit course 1" in the "user-grade" "table"
85
    And I should see "8.00" in the "user-grade" "table"
86
 
87
  @javascript
88
  Scenario: If the whole course final grade item is hidden, the associated subcourse activity grade item is marked as hidden, too.
89
    Given I am on "RefCourse" course homepage
90
    And I navigate to "Setup > Gradebook setup" in the course gradebook
91
    And I set the following settings for grade item "RefCourse":
92
      | Hidden          | 1 |
93
    And I am on "MainCourse" course homepage
94
    And I turn editing mode on
95
    And I add a "Subcourse" to section "1" and I fill the form with:
96
      | Subcourse name                    | Unit course 1       |
97
      | Fetch grades from                 | RefCourse (R)       |
98
      | Redirect to the referenced course | 0                   |
99
    And I turn editing mode off
100
    And I am on "MainCourse" course homepage
101
    And I am on the "Unit course 1" "subcourse activity" page logged in as teacher1
102
    When I follow "Fetch grades now"
103
    And I am on "MainCourse" course homepage
104
    And I navigate to "View > Grader report" in the course gradebook
105
    Then the following should exist in the "user-grades" table:
106
      | Email address         | -4-   |
107
      | student1@example.com  | 5.00  |
108
      | student2@example.com  | 8.00  |
109
    And I log out
110
    #
111
    # Student 1 should not see the grade in the referenced course.
112
    #
113
    And I log in as "student1"
114
    And I am on "MainCourse" course homepage
115
    And I navigate to "User report" in the course gradebook
116
    And I should see "MainCourse" in the "user-grade" "table"
117
    And I should not see "Unit course 1" in the "user-grade" "table"
118
    And I should not see "5.00" in the "user-grade" "table"
119
    And I log out
120
    #
121
    # Student 2 should not see the grade, too.
122
    #
123
    And I log in as "student2"
124
    And I am on "MainCourse" course homepage
125
    And I navigate to "User report" in the course gradebook
126
    And I should see "MainCourse" in the "user-grade" "table"
127
    And I should not see "Unit course 1" in the "user-grade" "table"
128
    And I should not see "8.00" in the "user-grade" "table"