Merge branch 'MDL-82391-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE

This commit is contained in:
Sara Arjona 2024-07-10 18:05:53 +02:00
commit 45d839a7c8
No known key found for this signature in database
2 changed files with 31 additions and 1 deletions

View File

@ -85,7 +85,7 @@ class sectionselector implements named_templatable, renderable {
$numsections = $format->get_last_section_number();
while ($section <= $numsections) {
$thissection = $modinfo->get_section_info($section);
$url = course_get_url($course, $section);
$url = course_get_url($course, $section, ['navigation' => true]);
if ($thissection->uservisible && $url && $section != $data->currentsection) {
$sectionmenu[$url->out(false)] = get_section_name($course, $section);
}

View File

@ -0,0 +1,30 @@
@theme_classic
Feature: Select course sections using classic theme
In order to view course sections when using the classic theme
As a teacher
I need to select the section from the section selector
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| numsections | 3 |
| initsections | 1 |
And the following "activities" exist:
| course | activity | name | idnumber | section |
| C1 | assign | Assignment 1 | assign1 | 1 |
| C1 | assign | Assignment 2 | assign2 | 2 |
@javascript
Scenario: Use the course section selector in classic theme
Given I am on the "C1" "Course" page logged in as "admin"
And I turn editing mode on
When I choose the "View" item in the "Edit" action menu of the "Section 1" "section"
Then I should see "Section 1"
And I should see "Assignment 1"
And I should not see "Assignment 2"
And I select "Section 2" from the "jump" singleselect
And I should see "Section 2"
And I should not see "Assignment 1"
And I should see "Assignment 2"
And the "jump" select box should contain "Section 3"