tool_moodlenet/select_page

When returning to Moodle let the user select which course to add the resource to.

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

Members

(inner) The :string

Source:

id corresponding to the import.

Type:
  • string

Methods

(inner) addCourses(page)

Source:

Fetch the courses to show the user. We use the same WS structure & template as the search for consistency.

Parameters:
Name Type Description
page HTMLElement

The whole page element for our course page

(inner) debounce(func, wait, immediate) → {function}

Source:

Define our own debounce function as Moodle 3.7 does not have it.

Parameters:
Name Type Description
func function

The function we want to keep calling

wait number

Our timeout

immediate boolean

Do we want to apply the function immediately

Returns:
Type
function

(inner) init(importIdString)

Source:

Set up the page.

Parameters:
Name Type Description
importIdString string

the string ID of the import.

(inner) registerListenerEvents(page)

Source:

Add the event listeners to our page.

Parameters:
Name Type Description
page HTMLElement

The whole page element for our page

(inner) searchCourses(inputValue, page, areaReplace)

Source:

For a given input, the page & what to replace fetch courses and manage icons too.

Parameters:
Name Type Description
inputValue string

What to search for

page HTMLElement

The whole page element for our page

areaReplace HTMLElement

The Element to replace the contents of