MDL-68662 core_course: Add new tabs to the chooser
authorMathew May <mathewm@hotmail.co.nz>
Wed, 13 May 2020 03:14:56 +0000 (11:14 +0800)
committerMathew May <mathewm@hotmail.co.nz>
Wed, 20 May 2020 07:53:06 +0000 (15:53 +0800)
We now have two more tabs in the chooser.
Activities & Resources aer now offered in different tabs.

16 files changed:
admin/settings/courses.php
course/amd/build/activitychooser.min.js
course/amd/build/activitychooser.min.js.map
course/amd/build/local/activitychooser/dialogue.min.js
course/amd/build/local/activitychooser/dialogue.min.js.map
course/amd/build/local/activitychooser/selectors.min.js
course/amd/build/local/activitychooser/selectors.min.js.map
course/amd/src/activitychooser.js
course/amd/src/local/activitychooser/dialogue.js
course/amd/src/local/activitychooser/selectors.js
course/renderer.php
course/templates/activitychooser.mustache
course/tests/behat/activity_chooser.feature
course/tests/behat/recommend_activities.feature
course/tests/behat/search_recommended_activities.feature
lang/en/course.php

index 8936f7c..b6ba368 100644 (file)
@@ -61,12 +61,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
             array('moodle/restore:restorecourse')
         )
     );
-    $ADMIN->add('courses',
-        new admin_externalpage('activitychooser', new lang_string('activitychooserrecommendations', 'course'),
-            new moodle_url('/course/recommendations.php'),
-            array('moodle/course:recommendactivity')
-        )
-    );
 
     // Course Default Settings Page.
     // NOTE: these settings must be applied after all other settings because they depend on them.
@@ -187,6 +181,30 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
                 $CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
     }
 
+    // Add a category for the Activity Chooser.
+    $ADMIN->add('courses', new admin_category('activitychooser', new lang_string('activitychoosercategory', 'course')));
+    $temp = new admin_settingpage('activitychoosersettings', new lang_string('activitychoosersettings', 'course'));
+    $temp->add(
+        new admin_setting_configselect(
+            'activitychoosertabmode',
+            new lang_string('activitychoosertabmode', 'course'),
+            new lang_string('activitychoosertabmode_desc', 'course'),
+            0,
+            [
+                0 => new lang_string('activitychoosertabmodeone', 'course'),
+                1 => new lang_string('activitychoosertabmodetwo', 'course'),
+                2 => new lang_string('activitychoosertabmodethree', 'course'),
+            ]
+        )
+    );
+    $ADMIN->add('activitychooser', $temp);
+    $ADMIN->add('activitychooser',
+        new admin_externalpage('activitychooserrecommended', new lang_string('activitychooserrecommendations', 'course'),
+            new moodle_url('/course/recommendations.php'),
+            array('moodle/course:recommendactivity')
+        )
+    );
+
     // Add a category for backups.
     $ADMIN->add('courses', new admin_category('backups', new lang_string('backups','admin')));
 
index b3f553f..da936c1 100644 (file)
Binary files a/course/amd/build/activitychooser.min.js and b/course/amd/build/activitychooser.min.js differ
index 78345bc..83b317b 100644 (file)
Binary files a/course/amd/build/activitychooser.min.js.map and b/course/amd/build/activitychooser.min.js.map differ
index abfc5d3..dde9eec 100644 (file)
Binary files a/course/amd/build/local/activitychooser/dialogue.min.js and b/course/amd/build/local/activitychooser/dialogue.min.js differ
index 355a979..6f8a885 100644 (file)
Binary files a/course/amd/build/local/activitychooser/dialogue.min.js.map and b/course/amd/build/local/activitychooser/dialogue.min.js.map differ
index 1fddca8..0b4a6ed 100644 (file)
Binary files a/course/amd/build/local/activitychooser/selectors.min.js and b/course/amd/build/local/activitychooser/selectors.min.js differ
index bfa0617..177b53e 100644 (file)
Binary files a/course/amd/build/local/activitychooser/selectors.min.js.map and b/course/amd/build/local/activitychooser/selectors.min.js.map differ
index a66560e..0aa10d5 100644 (file)
@@ -31,16 +31,28 @@ import * as ModalFactory from 'core/modal_factory';
 import {get_string as getString} from 'core/str';
 import Pending from 'core/pending';
 
+// Set up some JS module wide constants that can be added to in the future.
+
+// Tab config options.
+const ALLACTIVITIESRESOURCES = 0;
+const ONLYALL = 1;
+const ACTIVITIESRESOURCES = 2;
+
+// Module types.
+const ACTIVITY = 0;
+const RESOURCE = 1;
+
 /**
  * Set up the activity chooser.
  *
  * @method init
  * @param {Number} courseId Course ID to use later on in fetchModules()
+ * @param {Object} chooserConfig Any PHP config settings that we may need to reference
  */
-export const init = courseId => {
+export const init = (courseId, chooserConfig) => {
     const pendingPromise = new Pending();
 
-    registerListenerEvents(courseId);
+    registerListenerEvents(courseId, chooserConfig);
 
     pendingPromise.resolve();
 };
@@ -50,8 +62,9 @@ export const init = courseId => {
  *
  * @method registerListenerEvents
  * @param {Number} courseId
+ * @param {Object} chooserConfig Any PHP config settings that we may need to reference
  */
-const registerListenerEvents = (courseId) => {
+const registerListenerEvents = (courseId, chooserConfig) => {
     const events = [
         'click',
         CustomEvents.events.activate,
@@ -108,7 +121,7 @@ const registerListenerEvents = (courseId) => {
 
                 bodyPromiseResolver(await Templates.render(
                     'core_course/activitychooser',
-                    templateDataBuilder(builtModuleData)
+                    templateDataBuilder(builtModuleData, chooserConfig)
                 ));
             }
         });
@@ -138,28 +151,57 @@ const sectionIdMapper = (webServiceData, id) => {
  *
  * @method templateDataBuilder
  * @param {Array} data our modules to manipulate into a Templatable object
+ * @param {Object} chooserConfig Any PHP config settings that we may need to reference
  * @return {Object} Our built object ready to render out
  */
-const templateDataBuilder = (data) => {
+const templateDataBuilder = (data, chooserConfig) => {
+    // Setup of various bits and pieces we need to mutate before throwing it to the wolves.
+    let activities = [];
+    let resources = [];
+    let showAll = true;
+    let showActivities = false;
+    let showResources = false;
+
+    // Tab mode can be the following [All, Resources & Activities, All & Activities & Resources].
+    const tabMode = parseInt(chooserConfig.tabmode);
+
     // Filter the incoming data to find favourite & recommended modules.
     const favourites = data.filter(mod => mod.favourite === true);
     const recommended = data.filter(mod => mod.recommended === true);
 
-    // Given the results of the above filters lets figure out what tab to set active.
+    // Both of these modes need Activity & Resource tabs.
+    if ((tabMode === ALLACTIVITIESRESOURCES || tabMode === ACTIVITIESRESOURCES) && tabMode !== ONLYALL) {
+        // Filter the incoming data to find activities then resources.
+        activities = data.filter(mod => mod.archetype === ACTIVITY);
+        resources = data.filter(mod => mod.archetype === RESOURCE);
+        showActivities = true;
+        showResources = true;
+
+        // We want all of the previous information but no 'All' tab.
+        if (tabMode === ACTIVITIESRESOURCES) {
+            showAll = false;
+        }
+    }
 
+    // Given the results of the above filters lets figure out what tab to set active.
     // We have some favourites.
     const favouritesFirst = !!favourites.length;
-    // Check if we have no favourites but have some recommended.
-    const recommendedFirst = !!(recommended.length && favouritesFirst === false);
+    // We are in tabMode 2 without any favourites.
+    const activitiesFirst = showAll === false && favouritesFirst === false;
     // We have nothing fallback to show all modules.
-    const fallback = favouritesFirst === false && recommendedFirst === false;
+    const fallback = showAll === true && favouritesFirst === false;
 
     return {
         'default': data,
+        showAll: showAll,
+        activities: activities,
+        showActivities: showActivities,
+        activitiesFirst: activitiesFirst,
+        resources: resources,
+        showResources: showResources,
         favourites: favourites,
         recommended: recommended,
         favouritesFirst: favouritesFirst,
-        recommendedFirst: recommendedFirst,
         fallback: fallback,
     };
 };
@@ -204,22 +246,22 @@ const nullFavouriteDomManager = (favouriteTabNav, modalBody) => {
         favouriteTabNav.setAttribute('aria-selected', 'false');
         const favouriteTab = modalBody.querySelector(selectors.regions.favouriteTab);
         favouriteTab.classList.remove('active');
-        const recommendedTabNav = modalBody.querySelector(selectors.regions.recommendedTabNav);
         const defaultTabNav = modalBody.querySelector(selectors.regions.defaultTabNav);
-        if (recommendedTabNav.classList.contains('d-none') === false) {
-            recommendedTabNav.classList.add('active');
-            recommendedTabNav.setAttribute('aria-selected', 'true');
-            recommendedTabNav.tabIndex = 0;
-            recommendedTabNav.focus();
-            const recommendedTab = modalBody.querySelector(selectors.regions.recommendedTab);
-            recommendedTab.classList.add('active');
-        } else {
+        const activitiesTabNav = modalBody.querySelector(selectors.regions.activityTabNav);
+        if (defaultTabNav.classList.contains('d-none') === false) {
             defaultTabNav.classList.add('active');
             defaultTabNav.setAttribute('aria-selected', 'true');
             defaultTabNav.tabIndex = 0;
             defaultTabNav.focus();
             const defaultTab = modalBody.querySelector(selectors.regions.defaultTab);
             defaultTab.classList.add('active');
+        } else {
+            activitiesTabNav.classList.add('active');
+            activitiesTabNav.setAttribute('aria-selected', 'true');
+            activitiesTabNav.tabIndex = 0;
+            activitiesTabNav.focus();
+            const activitiesTab = modalBody.querySelector(selectors.regions.activityTab);
+            activitiesTab.classList.add('active');
         }
 
     }
index 42a19b3..3cbc5e8 100644 (file)
@@ -194,9 +194,11 @@ const registerListenerEvents = (modal, mappedModules, partialFavourite) => {
         const activeSectionId = body.querySelector(selectors.elements.activetab).getAttribute("href");
         const sectionChooserOptions = body.querySelector(selectors.regions.getSectionChooserOptions(activeSectionId));
         const firstChooserOption = sectionChooserOptions.querySelector(selectors.regions.chooserOption.container);
+
         toggleFocusableChooserOption(firstChooserOption, true);
         initTabsKeyboardNavigation(body);
         initChooserOptionsKeyboardNavigation(body, mappedModules, sectionChooserOptions);
+
         return body;
     })
     .catch();
@@ -214,7 +216,9 @@ const initTabsKeyboardNavigation = (body) => {
     const favTabNav = body.querySelector(selectors.regions.favouriteTabNav);
     const recommendedTabNav = body.querySelector(selectors.regions.recommendedTabNav);
     const defaultTabNav = body.querySelector(selectors.regions.defaultTabNav);
-    const tabNavArray = [favTabNav, recommendedTabNav, defaultTabNav];
+    const activityTabNav = body.querySelector(selectors.regions.activityTabNav);
+    const resourceTabNav = body.querySelector(selectors.regions.resourceTabNav);
+    const tabNavArray = [favTabNav, recommendedTabNav, defaultTabNav, activityTabNav, resourceTabNav];
     tabNavArray.forEach((element) => {
         return element.addEventListener('keydown', (e) => {
             // The first visible navigation tab link.
@@ -556,6 +560,5 @@ export const displayChooser = (modalPromise, sectionModules, partialFavourite) =
         });
 
         return modal;
-    })
-    .catch();
+    }).catch();
 };
index 3a15f75..6b54bbc 100644 (file)
@@ -54,9 +54,13 @@ export default {
         favouriteTabNav: getDataSelector('region', 'favourite-tab-nav'),
         recommendedTabNav: getDataSelector('region', 'recommended-tab-nav'),
         defaultTabNav: getDataSelector('region', 'default-tab-nav'),
+        activityTabNav: getDataSelector('region', 'activity-tab-nav'),
+        resourceTabNav: getDataSelector('region', 'resources-tab-nav'),
         favouriteTab: getDataSelector('region', 'favourites'),
         recommendedTab: getDataSelector('region', 'recommended'),
         defaultTab: getDataSelector('region', 'default'),
+        activityTab: getDataSelector('region', 'activity'),
+        resourceTab: getDataSelector('region', 'resources'),
         getModuleSelector: modname => `[role="menuitem"][data-modname="${modname}"]`,
         searchResults: getDataSelector('region', 'search-results-container'),
         searchResultItems: getDataSelector('region', 'search-result-items-container'),
index 8d58bc8..af5d289 100644 (file)
@@ -158,7 +158,11 @@ class core_course_renderer extends plugin_renderer_base {
             return '';
         }
 
-        $this->page->requires->js_call_amd('core_course/activitychooser', 'init', [$courseid]);
+        // Build an object of config settings that we can then hook into in the Activity Chooser.
+        $chooserconfig = (object) [
+            'tabmode' => get_config('core', 'activitychoosertabmode'),
+        ];
+        $this->page->requires->js_call_amd('core_course/activitychooser', 'init', [$courseid, $chooserconfig]);
 
         return '';
     }
index 45d9a25..fe5fd22 100644 (file)
                         >
                             {{#str}} favourites, core {{/str}}
                         </a>
-                        <a class="nav-item nav-link {{#recommendedFirst}}active{{/recommendedFirst}} {{^recommended}}d-none{{/recommended}}"
-                           id="recommended-tab-{{uniqid}}"
-                           data-region="recommended-tab-nav"
-                           data-toggle="tab"
-                           href="#recommended-{{uniqid}}"
-                           role="tab"
-                           aria-label="{{#str}} aria:recommendedtab, core_course {{/str}}"
-                           aria-controls="recommended-{{uniqid}}"
-                           aria-selected="{{#recommendedFirst}}true{{/recommendedFirst}}{{^recommendedFirst}}false{{/recommendedFirst}}"
-                           tabindex="{{#recommendedFirst}}0{{/recommendedFirst}}{{^recommendedFirst}}-1{{/recommendedFirst}}"
-                        >
-                            {{#str}} recommended, core {{/str}}
-                        </a>
-                        <a class="nav-item nav-link {{#fallback}}active{{/fallback}}"
+                        <a class="nav-item nav-link {{#fallback}}active{{/fallback}} {{^showAll}}d-none{{/showAll}}"
                            id="all-tab-{{uniqid}}"
                            data-toggle="tab"
                            data-region="default-tab-nav"
                            aria-controls="all-{{uniqid}}"
                            aria-selected="{{#fallback}}true{{/fallback}}{{^fallback}}false{{/fallback}}"
                            tabindex="{{#fallback}}0{{/fallback}}{{^fallback}}-1{{/fallback}}"
+                        >
+                            {{#str}} all, core {{/str}}
+                        </a>
+                        <a class="nav-item nav-link {{#activitiesFirst}}active{{/activitiesFirst}} {{^showActivities}}d-none{{/showActivities}}"
+                           id="activity-tab-{{uniqid}}"
+                           data-toggle="tab"
+                           data-region="activity-tab-nav"
+                           href="#activity-{{uniqid}}"
+                           role="tab"
+                           aria-label="{{#str}} activities, core {{/str}}"
+                           aria-controls="activity-{{uniqid}}"
+                           aria-selected="{{#activitiesFirst}}true{{/activitiesFirst}}{{^activitiesFirst}}false{{/activitiesFirst}}"
+                           tabindex="{{#activitiesFirst}}0{{/activitiesFirst}}{{^activitiesFirst}}-1{{/activitiesFirst}}"
                         >
                             {{#str}} activities, core {{/str}}
                         </a>
+                        <a class="nav-item nav-link {{^showResources}}d-none{{/showResources}}"
+                           id="resources-tab-{{uniqid}}"
+                           data-toggle="tab"
+                           data-region="resources-tab-nav"
+                           href="#resources-{{uniqid}}"
+                           role="tab"
+                           aria-label="{{#str}} resources, core {{/str}}"
+                           aria-controls="resources-{{uniqid}}"
+                           aria-selected="false"
+                           tabindex="-1"
+                        >
+                            {{#str}} resources, core {{/str}}
+                        </a>
+                        <a class="nav-item nav-link {{^recommended}}d-none{{/recommended}}"
+                           id="recommended-tab-{{uniqid}}"
+                           data-region="recommended-tab-nav"
+                           data-toggle="tab"
+                           href="#recommended-{{uniqid}}"
+                           role="tab"
+                           aria-label="{{#str}} aria:recommendedtab, core_course {{/str}}"
+                           aria-controls="recommended-{{uniqid}}"
+                           aria-selected="false"
+                           tabindex="-1"
+                        >
+                            {{#str}} recommended, core {{/str}}
+                        </a>
                     </div>
                     <div class="tab-content" id="tabbed-activities-{{uniqid}}">
                         <div class="tab-pane {{#favouritesFirst}}active{{/favouritesFirst}}" id="starred-{{uniqid}}" data-region="favourites" role="tabpanel" aria-labelledby="starred-tab-{{uniqid}}">
                                 {{>core_course/local/activitychooser/favourites}}
                             </div>
                         </div>
-                        <div class="tab-pane {{#recommendedFirst}}active{{/recommendedFirst}}" id="recommended-{{uniqid}}" data-region="recommended" role="tabpanel" aria-labelledby="recommended-tab-{{uniqid}}">
+                        <div class="tab-pane {{#fallback}}active{{/fallback}} {{^showAll}}d-none{{/showAll}}" id="all-{{uniqid}}" data-region="default" role="tabpanel" aria-labelledby="all-tab-{{uniqid}}">
                             <div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
-                                {{#recommended}}
+                                {{#default}}
                                     {{>core_course/local/activitychooser/item}}
-                                {{/recommended}}
+                                {{/default}}
                             </div>
                         </div>
-                        <div class="tab-pane {{#fallback}}active{{/fallback}}" id="all-{{uniqid}}" data-region="default" role="tabpanel" aria-labelledby="all-tab-{{uniqid}}">
+                        <div class="tab-pane {{#activitiesFirst}}active{{/activitiesFirst}}" id="activity-{{uniqid}}" data-region="activity" role="tabpanel" aria-labelledby="activity-tab-{{uniqid}}">
                             <div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
-                                {{#default}}
+                                {{#activities}}
                                     {{>core_course/local/activitychooser/item}}
-                                {{/default}}
+                                {{/activities}}
+                            </div>
+                        </div>
+                        <div class="tab-pane" id="resources-{{uniqid}}" data-region="resources" role="tabpanel" aria-labelledby="resources-tab-{{uniqid}}">
+                            <div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
+                                {{#resources}}
+                                    {{>core_course/local/activitychooser/item}}
+                                {{/resources}}
+                            </div>
+                        </div>
+                        <div class="tab-pane" id="recommended-{{uniqid}}" data-region="recommended" role="tabpanel" aria-labelledby="recommended-tab-{{uniqid}}">
+                            <div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
+                                {{#recommended}}
+                                    {{>core_course/local/activitychooser/item}}
+                                {{/recommended}}
                             </div>
                         </div>
                     </div>
index 98ef06a..578e19c 100644 (file)
@@ -58,7 +58,7 @@ Feature: Display and choose from the available activities in course
     When I log out
     And I log in as "admin"
     And I am on site homepage
-    And I navigate to "Courses > Recommended activities" in site administration
+    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     And I click on ".activity-recommend-checkbox" "css_element" in the "Book" "table_row"
     # Setup done, lets check it works with a teacher.
     And I log out
@@ -148,3 +148,40 @@ Feature: Display and choose from the available activities in course
     Then I should not see "Search query"
     And ".searchresultscontainer" "css_element" should not exist
     And ".optionscontainer" "css_element" should exist
+
+  Scenario: Teacher gets the base case for the Activity Chooser tab mode
+    Given I click on "Add an activity" "button" in the "Topic 1" "section"
+    And I should see "Activities" in the "Add an activity" "dialogue"
+    When I click on "Activities" "link" in the "Add an activity" "dialogue"
+    Then I should not see "Book" in the "activity" "core_course > Activity chooser tab"
+    And I click on "Resources" "link" in the "Add an activity" "dialogue"
+    And I should not see "Assignment" in the "resources" "core_course > Activity chooser tab"
+
+  Scenario: Teacher gets the simple case for the Activity Chooser tab mode
+    Given I log out
+    And I log in as "admin"
+    And I am on site homepage
+    When I navigate to "Courses > Activity chooser > Activity chooser settings" in site administration
+    And I select "Starred, All, Recommended" from the "Activity chooser tabs" singleselect
+    And I press "Save changes"
+    And I log out
+    And I log in as "teacher"
+    And I am on "Course" course homepage with editing mode on
+    And I click on "Add an activity" "button" in the "Topic 1" "section"
+    Then I should not see "Activities" in the "Add an activity" "dialogue"
+    And I should not see "Resources" in the "Add an activity" "dialogue"
+
+  Scenario: Teacher gets the final case for the Activity Chooser tab mode
+    Given I log out
+    And I log in as "admin"
+    And I am on site homepage
+    When I navigate to "Courses > Activity chooser > Activity chooser settings" in site administration
+    And I select "Starred, Activities, Resources, Recommended" from the "Activity chooser tabs" singleselect
+    And I press "Save changes"
+    And I log out
+    And I log in as "teacher"
+    And I am on "Course" course homepage with editing mode on
+    And I click on "Add an activity" "button" in the "Topic 1" "section"
+    Then I should not see "All" in the "Add an activity" "dialogue"
+    And I should see "Activities" in the "Add an activity" "dialogue"
+    And I should see "Resources" in the "Add an activity" "dialogue"
index 2b2e68d..818d935 100644 (file)
@@ -5,24 +5,24 @@ Feature: Recommending activities
   Scenario: As an admin I can recommend activities from an admin setting page.
     Given I log in as "admin"
     And I am on site homepage
-    And I navigate to "Courses > Recommended activities" in site administration
+    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     And I click on ".activity-recommend-checkbox" "css" in the "Assignment" "table_row"
     And I navigate to "Courses > Add a new course" in site administration
-    When I navigate to "Courses > Recommended activities" in site administration
+    When I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     Then "input[aria-label=\"Recommend activity: Assignment\"][checked=checked]" "css_element" should exist
     And "input[aria-label=\"Recommend activity: Book\"]:not([checked=checked])" "css_element" should exist
 
   Scenario: As an admin I can remove recommend activities from an admin setting page.
     Given I log in as "admin"
     And I am on site homepage
-    And I navigate to "Courses > Recommended activities" in site administration
+    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     And I click on ".activity-recommend-checkbox" "css" in the "Assignment" "table_row"
     And I navigate to "Courses > Add a new course" in site administration
-    And I navigate to "Courses > Recommended activities" in site administration
+    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     And "input[aria-label=\"Recommend activity: Assignment\"][checked=checked]" "css_element" should exist
     And "input[aria-label=\"Recommend activity: Book\"]:not([checked=checked])" "css_element" should exist
     And I click on ".activity-recommend-checkbox" "css" in the "Assignment" "table_row"
     And I navigate to "Courses > Add a new course" in site administration
-    When I navigate to "Courses > Recommended activities" in site administration
+    When I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     Then "input[aria-label=\"Recommend activity: Assignment\"]:not([checked=checked])" "css_element" should exist
     And "input[aria-label=\"Recommend activity: Book\"]:not([checked=checked])" "css_element" should exist
index 3575aaf..202839d 100644 (file)
@@ -5,7 +5,7 @@ Feature: Search recommended activities
   Scenario: Search results are returned if the search query matches any activity names
     Given I log in as "admin"
     And I am on site homepage
-    And I navigate to "Courses > Recommended activities" in site administration
+    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     When I set the field "search" to "assign"
     And I click on "Submit search" "button"
     Then I should see "Search results: 1"
@@ -15,7 +15,7 @@ Feature: Search recommended activities
   Scenario: Search results are not returned if the search query does not match with any activity names
     Given I log in as "admin"
     And I am on site homepage
-    And I navigate to "Courses > Recommended activities" in site administration
+    And I navigate to "Courses > Activity chooser > Recommended activities" in site administration
     When I set the field "search" to "random query"
     And I click on "Submit search" "button"
     Then I should see "Search results: 0"
index c6a8d9a..0a19d43 100644 (file)
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
+$string['activitychoosercategory'] = 'Activity chooser';
 $string['activitychooserrecommendations'] = 'Recommended activities';
+$string['activitychoosersettings'] = 'Activity chooser settings';
+$string['activitychoosertabmode'] = 'Activity chooser tabs';
+$string['activitychoosertabmode_desc'] = "The activity chooser enables a teacher to easily select activities and resources to add to their course. This setting determines which tabs should be displayed in it. Note that the starred tab is only displayed for a user if they have starred one or more activities and the recommended tab is only displayed if a site administrator has specified some recommended activities.";
+$string['activitychoosertabmodeone'] = 'Starred, All, Activities, Resources, Recommended';
+$string['activitychoosertabmodetwo'] = 'Starred, All, Recommended';
+$string['activitychoosertabmodethree'] = 'Starred, Activities, Resources, Recommended';
 $string['aria:coursecategory'] = 'Course category';
 $string['aria:courseimage'] = 'Course image';
 $string['aria:courseshortname'] = 'Course short name';