core_course/local/activitychooser/exporter

Description:
  • Module to generate template data for the activity chooser.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Module to generate template data for the activity chooser.

Methods

countTabItems(tabData) → {Number}

Description:
  • Get the number of items in a tab.

Source:
Parameters:
Name Type Description
tabData TabData

The tab data.

Returns:

The number of items in the tab.

Type
Number

(async) getFavouriteTabData(modulesData) → {Promise.<TabData>}

Description:
  • Get the favourite tab data.

Source:
Parameters:
Name Type Description
modulesData Array | Map

Modules data to be used in the chooser.

Returns:

Promise resolved with the template data.

Type
Promise.<TabData>

(async) getModChooserTemplateData(modulesData) → {Promise.<Object>}

Description:
  • Fetch the chooser template data for a specific section.

Source:
Parameters:
Name Type Description
modulesData Array | Map

Modules data to be used in the chooser.

Returns:

Promise resolved with the template data.

Type
Promise.<Object>

getSearchResultData(resultsModulesData) → {Object}

Description:
  • Get the search result template data.

Source:
Parameters:
Name Type Description
resultsModulesData Array | Map

Modules data to be used in the chooser.

Returns:

The template data.

Type
Object

normaliseModulesData(modulesData) → {Array}

Description:
  • Normalise the modules data to be used in the chooser.

    The modulesData can be a plain array or a Map. This method will convert it to a plain array of objects.

Source:
Parameters:
Name Type Description
modulesData Array | Map

Modules data to be used in the chooser.

Returns:

Normalised modules data.

Type
Array

(async, inner) loadNecessaryStrings() → {Promise.<Object>}

Description:
  • Load the necessary strings for the activity chooser.

Source:
Returns:

Promise resolved with the loaded strings.

Type
Promise.<Object>

Type Definitions

TabData

Description:
  • A tab data structure.

Source:
Properties:
Name Type Description
tabId String

the tab ID

active Boolean

whether the tab is active or not

items Array

the filtered modules to be displayed in the tab

displayed Boolean

whether the tab is displayed or not

tabLabel String

the tab label

tabHelp String | null

the help text for the tab (optional)

A tab data structure.

Type:
  • object