1 @core @core_courseformat
2 Feature: Varify section visibility interface
3 In order to edit the course sections visibility
5 I need to be able to see the updated visibility information
8 Given the following "course" exists:
9 | fullname | Course 1 |
14 And the following "activities" exist:
15 | activity | name | intro | course | idnumber | section |
16 | assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
17 And the following "users" exist:
18 | username | firstname | lastname | email |
19 | teacher1 | Teacher | 1 | teacher1@example.com |
20 | student1 | Student | 1 | student1@example.com |
21 And the following "course enrolments" exist:
22 | user | course | role |
23 | teacher1 | C1 | editingteacher |
24 Given I am on the "C1" "Course" page logged in as "teacher1"
25 And I turn editing mode on
28 Scenario: Activities available but not shown on course page only apply to hidden sections.
29 Given I hide section "1"
30 And I open "Activity sample 1" actions menu
31 And I choose "Availability > Make available but don't show on course page" in the open action menu
32 And I should see "Available but not shown on course page" in the "Activity sample 1" "activity"
33 When I show section "1"
34 Then I should not see "Available but not shown on course page" in the "Activity sample 1" "activity"
37 Scenario: Hide a section also hides the activities.
38 When I hide section "1"
39 Then I should see "Hidden from students" in the "Section 1" "section"
40 And I should see "Hidden from students" in the "Activity sample 1" "activity"
41 And I show section "1"
42 And I should not see "Hidden from students" in the "Section 1" "section"
43 And I should not see "Hidden from students" in the "Activity sample 1" "activity"
46 Scenario: Hidden activities in hidden sections stay hidden when the section is shown.
47 Given I open "Activity sample 1" actions menu
48 And I choose "Hide" in the open action menu
49 And I should see "Hidden from students" in the "Activity sample 1" "activity"
50 And I hide section "1"
51 And I should see "Hidden from students" in the "Activity sample 1" "activity"
52 When I show section "1"
53 Then I should see "Hidden from students" in the "Activity sample 1" "activity"
56 Scenario: Hidden sections can be shown and hidden using the drop down menu in the activity card.
57 Given I hide section "1"
58 When I click on "Hidden from students" "button" in the "Section 1" "section"
59 And I should see "Show on course page" in the "Section 1" "section"
60 And I should see "Hide on course page" in the "Section 1" "section"
61 And I click on "Show on course page" "link" in the "Section 1" "section"
62 Then I should not see "Hidden from students" in the "Section 1" "section"
65 Scenario: Hidden sections are shown as "not available" to student when
66 the course is set to show hidden sections "not available". They are shown
67 as "hidden from students" to editing teachers.
68 Given the following "courses" exist:
69 | fullname | shortname | format | hiddensections | numsections | initsections |
70 | Course 2 | C2 | topics | 0 | 3 | 1 |
71 And the following "course enrolments" exist:
72 | user | course | role |
73 | student1 | C2 | student |
74 | teacher1 | C2 | editingteacher |
75 And I am on the "C2" "Course" page logged in as "admin"
76 And I turn editing mode on
77 And I hide section "1"
79 When I am on the "C2" "Course" page logged in as "student1"
80 Then I should see "Not available" in the "Section 1" "section"
82 And I am on the "C2" "Course" page logged in as "teacher1"
83 And I should see "Hidden from students" in the "Section 1" "section"