1 |
efrain |
1 |
@block @block_completionstatus
|
|
|
2 |
Feature: Enable Block Completion in a course
|
|
|
3 |
In order to view the completion block in a course
|
|
|
4 |
As a teacher
|
|
|
5 |
I can add completion block to a course
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email | idnumber |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com | S1 |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category | enablecompletion |
|
|
|
14 |
| Course 1 | C1 | 0 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
|
|
|
20 |
Scenario: Add the block to a the course where completion is disabled
|
|
|
21 |
Given I log in as "teacher1"
|
|
|
22 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
23 |
And I navigate to "Settings" in current page administration
|
|
|
24 |
And I set the following fields to these values:
|
|
|
25 |
| Enable completion tracking | No |
|
|
|
26 |
And I press "Save and display"
|
|
|
27 |
When I add the "Course completion status" block
|
|
|
28 |
Then I should see "Completion is not enabled for this course" in the "Course completion status" "block"
|
|
|
29 |
|
|
|
30 |
Scenario: Add the block to a the course where completion is not set
|
|
|
31 |
Given I log in as "teacher1"
|
|
|
32 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
33 |
When I add the "Course completion status" block
|
|
|
34 |
Then I should see "No completion criteria set for this course" in the "Course completion status" "block"
|
|
|
35 |
|
|
|
36 |
Scenario: Add the block to a course with criteria and view as an untracked role.
|
|
|
37 |
Given the following "activities" exist:
|
|
|
38 |
| activity | course | idnumber | name | intro |
|
|
|
39 |
| page | C1 | page1 | Test page name | Test page description |
|
|
|
40 |
And I log in as "teacher1"
|
|
|
41 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
42 |
And I follow "Test page name"
|
|
|
43 |
And I navigate to "Settings" in current page administration
|
|
|
44 |
And I set the following fields to these values:
|
|
|
45 |
| Add requirements | 1 |
|
|
|
46 |
| View the activity | 1 |
|
|
|
47 |
And I press "Save and return to course"
|
|
|
48 |
When I add the "Course completion status" block
|
|
|
49 |
And I navigate to "Course completion" in current page administration
|
|
|
50 |
And I expand all fieldsets
|
|
|
51 |
And I set the following fields to these values:
|
|
|
52 |
| Test page name | 1 |
|
|
|
53 |
And I press "Save changes"
|
|
|
54 |
Then I should see "You are currently not being tracked by completion in this course" in the "Course completion status" "block"
|