mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-82574 mod_subsection: Remove module from activity chooser
* Fix behat tests to take into consideration the new add subsection workflow * modulename_help is only used in the activity chooser so has been removed
This commit is contained in:
parent
74cfbbacc6
commit
ca55b62b43
3 changed files with 22 additions and 6 deletions
|
@ -24,7 +24,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$string['modulename'] = 'Subsection';
|
$string['modulename'] = 'Subsection';
|
||||||
$string['modulename_help'] = 'Delegated subsections';
|
|
||||||
$string['modulenameplural'] = 'Subsections';
|
$string['modulenameplural'] = 'Subsections';
|
||||||
$string['pluginadministration'] = 'Subsection administration';
|
$string['pluginadministration'] = 'Subsection administration';
|
||||||
$string['pluginname'] = 'Subsection';
|
$string['pluginname'] = 'Subsection';
|
||||||
|
|
|
@ -301,3 +301,22 @@ function mod_subsection_get_fontawesome_icon_map() {
|
||||||
'mod_subsection:subsection' => 'fa-rectangle-list',
|
'mod_subsection:subsection' => 'fa-rectangle-list',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the course content items for the subsection module.
|
||||||
|
*
|
||||||
|
* This function is called when the course content is being generated for the activity chooser.
|
||||||
|
* However, here this module is never shown in the activity chooser so we return an empty array.
|
||||||
|
*
|
||||||
|
* @param \core_course\local\entity\content_item $contentitem
|
||||||
|
* @param stdClass $user
|
||||||
|
* @param stdClass $course
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function mod_subsection_get_course_content_items(
|
||||||
|
core_course\local\entity\content_item $contentitem,
|
||||||
|
stdClass $user,
|
||||||
|
stdClass $course
|
||||||
|
): array {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
|
@ -17,16 +17,14 @@ Feature: Teacher can only add subsection when certain conditions are met
|
||||||
| teacher1 | C1 | editingteacher |
|
| teacher1 | C1 | editingteacher |
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: The activity chooser filter subsections when section limit is reached
|
Scenario: We cannot add subsections when maxsections is reached
|
||||||
Given the following config values are set as admin:
|
Given the following config values are set as admin:
|
||||||
| maxsections | 10 | moodlecourse |
|
| maxsections | 10 | moodlecourse |
|
||||||
And I log in as "teacher1"
|
And I log in as "teacher1"
|
||||||
And I am on "Course 1" course homepage with editing mode on
|
And I am on "Course 1" course homepage with editing mode on
|
||||||
And I click on "Add content" "button" in the "Section 1" "section"
|
And I click on "Add content" "button" in the "Section 1" "section"
|
||||||
And I click on "Activity or resource" "button" in the ".dropdown-menu.show" "css_element"
|
And I click on "Subsection" "link" in the ".dropdown-menu.show" "css_element"
|
||||||
And I should see "Subsection" in the "Add an activity or resource" "dialogue"
|
|
||||||
When the following config values are set as admin:
|
When the following config values are set as admin:
|
||||||
| maxsections | 4 | moodlecourse |
|
| maxsections | 4 | moodlecourse |
|
||||||
And I am on "Course 1" course homepage
|
And I am on "Course 1" course homepage
|
||||||
Then I click on "Add an activity or resource" "button" in the "Section 1" "section"
|
And I should see "You have reached the maximum number of sections allowed for a course."
|
||||||
And I should not see "Subsection" in the "Add an activity or resource" "dialogue"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue