| 1441 |
ariadna |
1 |
@mod @mod_subsection
|
|
|
2 |
Feature: Subsection visibility should work as a module
|
|
|
3 |
In order to hide and show subsections
|
|
|
4 |
As a teacher
|
|
|
5 |
I need subsections to behave as any other module
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "course" exists:
|
|
|
9 |
| fullname | Course 1 |
|
|
|
10 |
| shortname | C1 |
|
|
|
11 |
| category | 0 |
|
|
|
12 |
| numsections | 2 |
|
|
|
13 |
| initsections | 1 |
|
|
|
14 |
And the following "users" exist:
|
|
|
15 |
| username | firstname | lastname |
|
|
|
16 |
| teacher1 | Teacher | 1 |
|
|
|
17 |
| student1 | Student | 1 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1 | C1 | editingteacher |
|
|
|
21 |
| student1 | C1 | student |
|
|
|
22 |
And I log in as "teacher1"
|
|
|
23 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
24 |
|
|
|
25 |
@javascript
|
|
|
26 |
Scenario: Subsections created on a hidden section behave like a normal module when parent visibility is toggled
|
|
|
27 |
Given I should not see "Hidden from student"
|
|
|
28 |
When I hide section "Section 1"
|
|
|
29 |
And I should see "Hidden from students" in the "Section 1" "section"
|
|
|
30 |
# We cannot use generators because they don't check the parent section visibility.
|
|
|
31 |
And I add a subsection activity to course "Course 1" section "1"
|
|
|
32 |
And I set the field "Name" to "Subsection 1"
|
|
|
33 |
And I press "Save and return to course"
|
|
|
34 |
And I add a assign activity to course "Course 1" section "1" and I fill the form with:
|
|
|
35 |
| Assignment name | Hidden assignment name |
|
|
|
36 |
| ID number | assign1 |
|
|
|
37 |
| Description | Hidden assignment description |
|
|
|
38 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
39 |
Then I should see "Hidden from students" in the "Subsection 1" "section"
|
|
|
40 |
And I should see "Hidden from students" in the "Hidden assignment name" "activity"
|
|
|
41 |
And I show section "Section 1"
|
|
|
42 |
And I should see "Hidden from students" in the "Subsection 1" "section"
|
|
|
43 |
And I should see "Hidden from students" in the "Hidden assignment name" "activity"
|
|
|
44 |
|
|
|
45 |
@javascript
|
|
|
46 |
Scenario: Subsections created on a visible section behave like a normal module when parent visibility is toggled
|
|
|
47 |
Given I should not see "Hidden from student"
|
|
|
48 |
And the following "activities" exist:
|
|
|
49 |
| activity | name | course | idnumber | section |
|
|
|
50 |
| subsection | Subsection 1 | C1 | subsection1 | 1 |
|
|
|
51 |
| page | Page 1 | C1 | page1 | 1 |
|
|
|
52 |
When I am on "Course 1" course homepage
|
|
|
53 |
And I should not see "Hidden from students" in the "Subsection 1" "section"
|
|
|
54 |
And I should not see "Hidden from students" in the "Page 1" "activity"
|
|
|
55 |
Then I hide section "Section 1"
|
|
|
56 |
And I should see "Hidden from students" in the "Subsection 1" "section"
|
|
|
57 |
And I should see "Hidden from students" in the "Page 1" "activity"
|
|
|
58 |
And I show section "Section 1"
|
|
|
59 |
And I should not see "Hidden from students" in the "Subsection 1" "section"
|
|
|
60 |
And I should not see "Hidden from students" in the "Page 1" "activity"
|