1 |
efrain |
1 |
@mod @mod_subcourse
|
|
|
2 |
Feature: Grades are fetched automatically from the referenced course
|
|
|
3 |
In order to see student's final course grade as a grade item in another course
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to give the final grade in a referenced course and that's enough
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Grade is immediately copied from a subcourse to the master course
|
|
|
9 |
Given the following "users" exist:
|
|
|
10 |
| username | firstname | lastname | email |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
| student1 | Student | 1 | student1@example.com |
|
|
|
13 |
| student2 | Student | 2 | student2@example.com |
|
|
|
14 |
And the following "courses" exist:
|
|
|
15 |
| fullname | shortname | category |
|
|
|
16 |
| MainCourse | M | 0 |
|
|
|
17 |
| RefCourse | R | 0 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1 | M | editingteacher |
|
|
|
21 |
| student1 | M | student |
|
|
|
22 |
| teacher1 | R | editingteacher |
|
|
|
23 |
| student1 | R | student |
|
|
|
24 |
| student2 | R | student |
|
|
|
25 |
And I log in as "admin"
|
|
|
26 |
#
|
|
|
27 |
# We use Mean of grades in this test to be able to override the maximum course grade.
|
|
|
28 |
#
|
|
|
29 |
And I set the following administration settings values:
|
|
|
30 |
| grade_aggregations_visible | Mean of grades |
|
|
|
31 |
And I log out
|
|
|
32 |
#
|
|
|
33 |
# Set grades in the referenced course.
|
|
|
34 |
#
|
|
|
35 |
And I log in as "teacher1"
|
|
|
36 |
And I am on "RefCourse" course homepage
|
|
|
37 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
38 |
And I click on "Edit" "link" in the "RefCourse" "table_row"
|
|
|
39 |
And I click on "Edit settings" "link" in the "RefCourse" "table_row"
|
|
|
40 |
And I set the following fields to these values:
|
|
|
41 |
| Aggregation | Mean of grades |
|
|
|
42 |
| Maximum grade | 1000 |
|
|
|
43 |
And I press "Save changes"
|
|
|
44 |
And I press "Add grade item"
|
|
|
45 |
And I set the following fields to these values:
|
|
|
46 |
| Item name | Manual item 1 |
|
|
|
47 |
| Maximum grade | 200 |
|
|
|
48 |
And I press "Save changes"
|
|
|
49 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
50 |
And I turn editing mode on
|
|
|
51 |
And I give the grade "100" to the user "Student 1" for the grade item "Manual item 1"
|
|
|
52 |
And I give the grade "50" to the user "Student 2" for the grade item "Manual item 1"
|
|
|
53 |
And I press "Save changes"
|
|
|
54 |
And I turn editing mode off
|
|
|
55 |
#
|
|
|
56 |
# Create the subcourse instance.
|
|
|
57 |
#
|
|
|
58 |
And I am on "MainCourse" course homepage
|
|
|
59 |
And I turn editing mode on
|
|
|
60 |
And I add a "Subcourse" to section "1" and I fill the form with:
|
|
|
61 |
| Subcourse name | Unit course 1 |
|
|
|
62 |
| Fetch grades from | RefCourse (R) |
|
|
|
63 |
| Redirect to the referenced course | 0 |
|
|
|
64 |
And I turn editing mode off
|
|
|
65 |
And I am on the "Unit course 1" "subcourse activity" page logged in as teacher1
|
|
|
66 |
#
|
|
|
67 |
# Upon creation, no grades are fetched yet.
|
|
|
68 |
#
|
|
|
69 |
Then I should see "The grades have not been fetched yet"
|
|
|
70 |
And I follow "Fetch grades now"
|
|
|
71 |
And I should see "Last fetch:"
|
|
|
72 |
#
|
|
|
73 |
# After fetching, the grades are copied.
|
|
|
74 |
#
|
|
|
75 |
And I am on "MainCourse" course homepage
|
|
|
76 |
And I navigate to "View > User report" in the course gradebook
|
|
|
77 |
And I click on "Student 1" in the "user" search widget
|
|
|
78 |
And the following should exist in the "user-grade" table:
|
|
|
79 |
| Grade item | Grade | Range |
|
|
|
80 |
| Unit course 1 | 500 | 0–1000 |
|
|
|
81 |
#
|
|
|
82 |
# Changing grades in the referenced course has instant effect.
|
|
|
83 |
#
|
|
|
84 |
And I am on "RefCourse" course homepage
|
|
|
85 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
86 |
And I turn editing mode on
|
|
|
87 |
And I give the grade "150" to the user "Student 1" for the grade item "Manual item 1"
|
|
|
88 |
And I press "Save changes"
|
|
|
89 |
And I turn editing mode off
|
|
|
90 |
And I am on "MainCourse" course homepage
|
|
|
91 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
92 |
And I should not see "Student 2"
|
|
|
93 |
And I am on "MainCourse" course homepage
|
|
|
94 |
And I navigate to "View > User report" in the course gradebook
|
|
|
95 |
And I click on "Student 1" in the "user" search widget
|
|
|
96 |
And the following should exist in the "user-grade" table:
|
|
|
97 |
| Grade item | Grade | Range |
|
|
|
98 |
| Unit course 1 | 750 | 0–1000 |
|
|
|
99 |
#
|
|
|
100 |
# Enrolling a student into the master course brings her grades instantly
|
|
|
101 |
#
|
|
|
102 |
And the following "course enrolments" exist:
|
|
|
103 |
| user | course | role |
|
|
|
104 |
| student2 | M | student |
|
|
|
105 |
And I am on "MainCourse" course homepage
|
|
|
106 |
And I navigate to "View > User report" in the course gradebook
|
|
|
107 |
And I click on "Student 2" in the "user" search widget
|
|
|
108 |
And the following should exist in the "user-grade" table:
|
|
|
109 |
| Grade item | Grade | Range |
|
|
|
110 |
| Unit course 1 | 250 | 0–1000 |
|