1 |
efrain |
1 |
@core @core_course
|
|
|
2 |
Feature: Activities content download can be controlled
|
|
|
3 |
In order to allow or restrict access to download activity content
|
|
|
4 |
As a teacher
|
|
|
5 |
I can disable the content download of an 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 |
| manager1 | Manager | 1 | manager1@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname |
|
|
|
15 |
| Course 1 | C1 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| manager1 | C1 | manager |
|
|
|
21 |
And the following "activities" exist:
|
|
|
22 |
| activity | name | intro | introformat | course |
|
|
|
23 |
| page | Page1 | PageDesc1 | 1 | C1 |
|
|
|
24 |
And the following "activities" exist:
|
|
|
25 |
| activity | name | intro | introformat | course | downloadcontent |
|
|
|
26 |
| folder | Folder1 | FolderDesc1 | 1 | C1 | 0 |
|
|
|
27 |
And I log in as "admin"
|
|
|
28 |
And the following config values are set as admin:
|
|
|
29 |
| downloadcoursecontentallowed | 1 |
|
|
|
30 |
And I log out
|
|
|
31 |
|
|
|
32 |
Scenario: "Include in course content download" field default is set to "Yes" if nothing has been set
|
|
|
33 |
Given I am on the Page1 "Page Activity editing" page logged in as admin
|
|
|
34 |
Then the field "Include in course content download" matches value "Yes"
|
|
|
35 |
|
|
|
36 |
Scenario: "Include in course content download" field is not visible if course content is disabled on site level
|
|
|
37 |
Given I log in as "admin"
|
|
|
38 |
And the following config values are set as admin:
|
|
|
39 |
| downloadcoursecontentallowed | 0 |
|
|
|
40 |
And I am on the Page1 "Page Activity editing" page
|
|
|
41 |
Then "Include in course content download" "select" should not exist
|
|
|
42 |
|
|
|
43 |
Scenario: "Include in course content download" field is visible even if course content is disabled on course level
|
|
|
44 |
Given I log in as "admin"
|
|
|
45 |
And I am on "Course 1" course homepage
|
|
|
46 |
And I navigate to "Settings" in current page administration
|
|
|
47 |
When I set the field "Enable download course content" to "No"
|
|
|
48 |
And I press "Save and display"
|
|
|
49 |
And I am on the Page1 "Page Activity editing" page
|
|
|
50 |
Then "Include in course content download" "select" should exist
|
|
|
51 |
|
|
|
52 |
Scenario: "Include in course content download" field should be visible but not editable for users without configuredownloadcontent capability
|
|
|
53 |
Given I log in as "manager1"
|
|
|
54 |
And I am on the Folder1 "Folder Activity editing" page
|
|
|
55 |
And "Include in course content download" "field" should exist
|
|
|
56 |
And the following "role capability" exists:
|
|
|
57 |
| role | manager |
|
|
|
58 |
| moodle/course:configuredownloadcontent | prohibit |
|
|
|
59 |
When I am on the Folder1 "Folder Activity editing" page
|
|
|
60 |
Then I should see "Include in course content download"
|
|
|
61 |
And I should see "No"
|
|
|
62 |
And "Include in course content download" "select" should not exist
|