1 |
efrain |
1 |
@mod @mod_lesson
|
|
|
2 |
Feature: link to gradebook on the end of lesson page
|
|
|
3 |
In order to allow students to see their lesson grades
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to provide a link to gradebook on the end of lesson 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 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | course | idnumber |
|
|
|
21 |
| lesson | Test lesson | C1 | lesson1 |
|
|
|
22 |
And the following "mod_lesson > pages" exist:
|
|
|
23 |
| lesson | qtype | title | content |
|
|
|
24 |
| Test lesson | content | First page name | First page contents |
|
|
|
25 |
| Test lesson | content | Second page name | Second page contents |
|
|
|
26 |
And the following "mod_lesson > answers" exist:
|
|
|
27 |
| page | answer | jumpto |
|
|
|
28 |
| First page name | Next page | Next page |
|
|
|
29 |
| Second page name | Previous page | Previous page |
|
|
|
30 |
| Second page name | Next page | Next page |
|
|
|
31 |
|
|
|
32 |
Scenario: Link to gradebook for non practice lesson
|
|
|
33 |
When I am on the "Test lesson" "lesson activity" page logged in as student1
|
|
|
34 |
And I press "Next page"
|
|
|
35 |
And I press "Next page"
|
|
|
36 |
Then I should see "Congratulations - end of lesson reached"
|
|
|
37 |
And I should see "View grades"
|
|
|
38 |
And I follow "View grades"
|
|
|
39 |
And I should see "Student 1" in the "region-main" "region"
|
|
|
40 |
And I should see "Test lesson"
|
|
|
41 |
|
|
|
42 |
Scenario: No link to gradebook for non graded lesson
|
|
|
43 |
Given I am on the "Test lesson" "lesson activity editing" page logged in as teacher1
|
|
|
44 |
And I set the following fields to these values:
|
|
|
45 |
| Type | None |
|
|
|
46 |
And I press "Save and display"
|
|
|
47 |
When I am on the "Test lesson" "lesson activity" page logged in as student1
|
|
|
48 |
And I press "Next page"
|
|
|
49 |
And I press "Next page"
|
|
|
50 |
Then I should see "Congratulations - end of lesson reached"
|
|
|
51 |
And I should not see "View grades"
|
|
|
52 |
|
|
|
53 |
Scenario: No link to gradebook for practice lesson
|
|
|
54 |
Given I am on the "Test lesson" "lesson activity editing" page logged in as teacher1
|
|
|
55 |
And I set the following fields to these values:
|
|
|
56 |
| Practice lesson | Yes |
|
|
|
57 |
And I press "Save and display"
|
|
|
58 |
When I am on the "Test lesson" "lesson activity" page logged in as student1
|
|
|
59 |
And I press "Next page"
|
|
|
60 |
And I press "Next page"
|
|
|
61 |
Then I should see "Congratulations - end of lesson reached"
|
|
|
62 |
And I should not see "View grades"
|
|
|
63 |
|
|
|
64 |
Scenario: No link if Show gradebook to student disabled
|
|
|
65 |
Given I log in as "teacher1"
|
|
|
66 |
And I am on "Course 1" course homepage
|
|
|
67 |
And I navigate to "Settings" in current page administration
|
|
|
68 |
And I set the following fields to these values:
|
|
|
69 |
| Show gradebook to students | No |
|
|
|
70 |
And I press "Save and display"
|
|
|
71 |
When I am on the "Test lesson" "lesson activity" page logged in as student1
|
|
|
72 |
And I press "Next page"
|
|
|
73 |
And I press "Next page"
|
|
|
74 |
Then I should see "Congratulations - end of lesson reached"
|
|
|
75 |
And I should not see "View grades"
|
|
|
76 |
|
|
|
77 |
Scenario: No link to gradebook if no gradereport/user:view capability
|
|
|
78 |
Given the following "role capability" exists:
|
|
|
79 |
| role | student |
|
|
|
80 |
| gradereport/user:view | prevent |
|
|
|
81 |
When I am on the "Test lesson" "lesson activity" page logged in as student1
|
|
|
82 |
And I press "Next page"
|
|
|
83 |
And I press "Next page"
|
|
|
84 |
Then I should see "Congratulations - end of lesson reached"
|
|
|
85 |
And I should not see "View grades"
|