1 |
efrain |
1 |
@mod @mod_subcourse
|
|
|
2 |
Feature: Progress and grade in referenced course can be displayed on the course main page
|
|
|
3 |
In order to control the look and feel of my course outline page
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to configure whether progress and grade in the referenced course is displayed on my course main page
|
|
|
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 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| MainCourse | M | 0 |
|
|
|
15 |
| RefCourse | R | 0 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | M | editingteacher |
|
|
|
19 |
| student1 | M | student |
|
|
|
20 |
| teacher1 | R | editingteacher |
|
|
|
21 |
| student1 | R | student |
|
|
|
22 |
#
|
|
|
23 |
# Set grades in the referenced course.
|
|
|
24 |
#
|
|
|
25 |
And I log in as "teacher1"
|
|
|
26 |
And I am on "RefCourse" course homepage
|
|
|
27 |
And I navigate to "Settings" in current page administration
|
|
|
28 |
And I set the following fields to these values:
|
|
|
29 |
| Enable completion tracking | Yes |
|
|
|
30 |
And I press "Save and display"
|
|
|
31 |
And I turn editing mode on
|
|
|
32 |
And I add a "Text and media area" to section "1" and I fill the form with:
|
|
|
33 |
| Text | Just a simple module to activate progress tracking |
|
|
|
34 |
And I turn editing mode off
|
|
|
35 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
36 |
And I press "Add grade item"
|
|
|
37 |
And I set the following fields to these values:
|
|
|
38 |
| Item name | Manual item 1 |
|
|
|
39 |
| Maximum grade | 10 |
|
|
|
40 |
And I press "Save changes"
|
|
|
41 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
42 |
And I turn editing mode on
|
|
|
43 |
And I give the grade "5" to the user "Student 1" for the grade item "Manual item 1"
|
|
|
44 |
And I press "Save"
|
|
|
45 |
And I turn editing mode off
|
|
|
46 |
|
|
|
47 |
@javascript
|
|
|
48 |
Scenario: Progress and grade displayed on both course main page and subcourse view page.
|
|
|
49 |
Given I am on "MainCourse" course homepage
|
|
|
50 |
And I turn editing mode on
|
|
|
51 |
And I add a "Subcourse" to section "1" and I fill the form with:
|
|
|
52 |
| Subcourse name | Unit course 1 |
|
|
|
53 |
| Fetch grades from | RefCourse (R) |
|
|
|
54 |
| Redirect to the referenced course | 0 |
|
|
|
55 |
| Display progress from referenced course on course page | 1 |
|
|
|
56 |
| Display grade from referenced course on course page | 1 |
|
|
|
57 |
And I turn editing mode off
|
|
|
58 |
And I am on "MainCourse" course homepage
|
|
|
59 |
And I am on the "Unit course 1" "subcourse activity" page logged in as teacher1
|
|
|
60 |
And I follow "Fetch grades now"
|
|
|
61 |
And I log out
|
|
|
62 |
When I log in as "student1"
|
|
|
63 |
And I am on "MainCourse" course homepage
|
|
|
64 |
Then I should see "Progress:" in the "[data-activityname='Unit course 1']" "css_element"
|
|
|
65 |
And I should see "Current grade:" in the "[data-activityname='Unit course 1']" "css_element"
|
|
|
66 |
And I am on the "Unit course 1" "subcourse activity" page logged in as student1
|
|
|
67 |
And I should see "Progress:" in the ".subcourseinfo-progress" "css_element"
|
|
|
68 |
And I should see "Current grade:" in the ".subcourseinfo-grade" "css_element"
|
|
|
69 |
|
|
|
70 |
@javascript
|
|
|
71 |
Scenario: Progress and grade displayed on subcourse view page only.
|
|
|
72 |
Given I am on "MainCourse" course homepage
|
|
|
73 |
And I turn editing mode on
|
|
|
74 |
And I add a "Subcourse" to section "1" and I fill the form with:
|
|
|
75 |
| Subcourse name | Unit course 1 |
|
|
|
76 |
| Fetch grades from | RefCourse (R) |
|
|
|
77 |
| Redirect to the referenced course | 0 |
|
|
|
78 |
| Display progress from referenced course on course page | 0 |
|
|
|
79 |
| Display grade from referenced course on course page | 0 |
|
|
|
80 |
And I turn editing mode off
|
|
|
81 |
And I am on "MainCourse" course homepage
|
|
|
82 |
And I am on the "Unit course 1" "subcourse activity" page logged in as teacher1
|
|
|
83 |
And I follow "Fetch grades now"
|
|
|
84 |
And I log out
|
|
|
85 |
When I log in as "student1"
|
|
|
86 |
And I am on "MainCourse" course homepage
|
|
|
87 |
Then I should not see "Progress:" in the "[data-activityname='Unit course 1']" "css_element"
|
|
|
88 |
And I should not see "Current grade:" in the "[data-activityname='Unit course 1']" "css_element"
|
|
|
89 |
And I am on the "Unit course 1" "subcourse activity" page logged in as student1
|
|
|
90 |
And I should see "Progress:" in the ".subcourseinfo-progress" "css_element"
|
|
|
91 |
And I should see "Current grade:" in the ".subcourseinfo-grade" "css_element"
|