__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
@mod @mod_subsection
Feature: Testing subsection_access_restrictions in mod_subsection
In order restrict the access to subsections based on conditions
As a teacher
I need to set subsection conditions which prevent student access
Background:
Given I enable "subsection" "mod" plugin
And the following "users" exist:
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| student1 | Student | 1 |
| student2 | Student | 2 |
And the following "courses" exist:
| fullname | shortname | category | numsections | initsections |
| Course 1 | C1 | 0 | 2 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "groups" exist:
| course | name | idnumber |
| C1 | G1 | GI1 |
And the following "group members" exist:
| user | group |
| student1 | GI1 |
And the following "groupings" exist:
| name | course | idnumber |
| GX1 | C1 | GXI1 |
And the following "grouping groups" exist:
| grouping | group |
| GXI1 | GI1 |
And I log in as "teacher1"
Scenario: Teacher can set access restrictions to an existing subsection
Given the following "activities" exist:
| activity | name | course | idnumber | section |
| subsection | Subsection1 | C1 | Subsection1 | 1 |
| data | Subactivity | C1 | data1 | 3 |
When I am on the "C1 > Subsection1" "course > section settings" page
And I set the following fields to these values:
| Access restrictions | Grouping: GX1 |
And I press "Save changes"
Then I should see "Not available unless: You belong to a group in GX1"
And I log out
And I am on the "Course 1" "course" page logged in as "student1"
And I should see "Subsection1" in the "region-main" "region"
And I should see "Subactivity" in the "region-main" "region"
And I log out
And I am on the "Course 1" "course" page logged in as "student2"
And I should see "Not available unless: You belong to a group in GX1"
And I should not see "Subactivity"
Scenario: Teacher sets access restrictions to a new subsection
When I add a subsection activity to course "Course 1" section "1" and I fill the form with:
| Name | Subsection2 |
| Access restrictions | Grouping: GX1 |
Then I should see "Not available unless: You belong to a group in GX1"
And I log out
And I am on the "Course 1" "course" page logged in as "student1"
And I should see "Subsection2" in the "region-main" "region"
And I log out
And I am on the "Course 1" "course" page logged in as "student2"
And I should see "Subsection2" in the "region-main" "region"
And I should see "Not available unless: You belong to a group in GX1"
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| subsection_access_restrictions.feature | File | 3.01 KB | 0777 |
|
| subsection_actionmenu.feature | File | 11 KB | 0777 |
|
| subsection_coursepage.feature | File | 6.02 KB | 0777 |
|
| subsection_disabled_plugin.feature | File | 8.23 KB | 0777 |
|
| subsection_limit.feature | File | 1.37 KB | 0777 |
|
| subsection_navigation.feature | File | 4.32 KB | 0777 |
|
| subsection_no_completion.feature | File | 2.71 KB | 0777 |
|
| subsection_rename.feature | File | 2.7 KB | 0777 |
|
| subsection_sectionpage.feature | File | 2.13 KB | 0777 |
|
| subsection_visibility.feature | File | 3.12 KB | 0777 |
|
| subsection_visibility_badge.feature | File | 3.63 KB | 0777 |
|