AutorÃa | Ultima modificación | Ver Log |
@mod @mod_subsectionFeature: Courses should not lose subsection contents when mod_subsection is disabledIn order to disable subsectionsAs an adminCourses needs to be usable with mod_subsection disabledBackground:Given the following "users" exist:| username | firstname | lastname || teacher1 | Teacher | 1 || student1 | Student | 1 |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 |And the following "activities" exist:| activity | name | course | idnumber | section || forum | Activity Sample | C1 | forum1 | 1 || subsection | Subsection1 | C1 | Subsection1 | 1 || data | Subactivity | C1 | data1 | 3 |And I disable "subsection" "mod" pluginScenario: Teachers should see subsections as orphanedWhen I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I should see "Activity Sample" in the "Section 1" "section"And I should not see "Subsection1" in the "Section 1" "section"And I should see "Subsection1" in the "page-content" "region"Then I should see "Subactivity" in the "Subsection1" "section"And "Section 2" "section" should appear before "Subsection1" "section"And "Edit settings" "link" should not exist in the "Subsection1" "core_courseformat > Section actions menu"And "Duplicate" "link" should not exist in the "Subsection1" "core_courseformat > Section actions menu"And "Hide" "link" should not exist in the "Subsection1" "core_courseformat > Section actions menu"And "Move" "link" should not exist in the "Subsection1" "core_courseformat > Section actions menu"And "View" "link" should exist in the "Subsection1" "core_courseformat > Section actions menu"And "Delete" "link" should exist in the "Subsection1" "core_courseformat > Section actions menu"And "Permalink" "link" should not exist in the "Subsection1" "core_courseformat > Section actions menu"And I should see "This section and its content are not part of the course structure" in the "Subsection1" "section"Scenario: Students should not see orphaned subsectionsWhen I log in as "student1"And I am on "Course 1" course homepageThen I should see "Activity Sample" in the "page-content" "region"And I should not see "Subsection1" in the "page-content" "region"And I should not see "Subactivity" in the "page-content" "region"Scenario: Enabling again subsections should show the course as beforeGiven I log in as "teacher1"And I am on "Course 1" course homepageAnd I should see "Activity Sample" in the "Section 1" "section"And I should not see "Subsection1" in the "Section 1" "section"And I should see "Subsection1" in the "page-content" "region"And I should see "Subactivity" in the "Subsection1" "section"And "Section 2" "section" should appear before "Subsection1" "section"And I should see "This section and its content are not part of the course structure"When I enable "subsection" "mod" pluginAnd I am on "Course 1" course homepage with editing mode onThen I should see "Activity Sample" in the "Section 1" "section"And I should see "Subsection1" in the "Section 1" "section"And I should see "Subactivity" in the "Subsection1" "section"And "Subsection1" "section" should appear before "Section 2" "section"And "Edit settings" "link" should exist in the "Subsection1" "core_courseformat > Section actions menu"And "Duplicate" "link" should not exist in the "Subsection1" "core_courseformat > Section actions menu"And "Hide" "link" should exist in the "Subsection1" "core_courseformat > Section actions menu"And "Move" "link" should exist in the "Subsection1" "core_courseformat > Section actions menu"And "View" "link" should exist in the "Subsection1" "core_courseformat > Section actions menu"And "Delete" "link" should exist in the "Subsection1" "core_courseformat > Section actions menu"And I should not see "This section and its content are not part of the course structure"@javascriptScenario: Deleting the subsections with mod_subsection disabled should not break the courseGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode on# Perform teacher actions instead of fast steps to validate delete# an orphaned subsection does not break the course.And I click on "Edit" "icon" in the "Subsection1" "core_courseformat > Section actions menu"When I choose "Delete" in the open action menuAnd I click on "Delete" "button" in the "Delete section?" "dialogue"Then I enable "subsection" "mod" pluginAnd I am on "Course 1" course homepageAnd I should see "Activity Sample" in the "Section 1" "section"And I should see "Subsection1" in the "page-content" "region"And I should not see "Subactivity" in the "page-content" "region"@javascriptScenario: Access restrictions are restored when a subsection is deleted while mod_subsection is disabledGiven I enable "subsection" "mod" pluginAnd 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"And I am on the "C1 > Subsection1" "course > section settings" pageAnd I set the following fields to these values:| Access restrictions | Grouping: GX1 |And I press "Save changes"And I should see "Not available unless: You belong to a group in GX1"And I disable "subsection" "mod" pluginWhen I am on "Course 1" course homepage with editing mode onAnd I should see "This section and its content are not part of the course structure" in the "Subsection1" "section"And I should see "Not available unless: You belong to a group in GX1"And I should not see "Edit restrictions"And I am on the "C1 > Subsection1" "course > section" pageAnd I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"And I choose "Delete" in the open action menuAnd I click on "Delete" "button" in the "Delete section?" "dialogue"And I enable "subsection" "mod" pluginThen I am on "Course 1" course homepageAnd I should see "Not available unless: You belong to a group in GX1"And I should see "Edit restrictions"@javascriptScenario: Visibility is restored when a subsection is deleted while mod_subsection is disabledGiven I enable "subsection" "mod" pluginAnd the following "activities" exist:| activity | name | course | idnumber | section | visible || subsection | Subsection2 | C1 | Subsection2 | 1 | 0 |And I log in as "teacher1"And I disable "subsection" "mod" pluginWhen I am on the "C1 > Subsection2" "course > section" pageAnd I turn editing mode onAnd I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"And I choose "Delete" in the open action menuAnd I click on "Delete" "button" in the "Delete section?" "dialogue"And I enable "subsection" "mod" pluginThen I am on "Course 1" course homepageAnd I should see "Hidden from students"@javascriptScenario: Orphaned sections should appear after any other sectionGiven I log in as "teacher1"When I am on "Course 1" course homepage with editing mode onAnd I click on "Add section" "link" in the "course-addsection" "region"Then I should see "New section"And "Section 2" "section" should appear before "New section" "section"And "New section" "section" should appear before "Subsection1" "section"