- Description:
A javascript module to handle user AJAX actions.
- Source:
- Copyright:
- 2019 Mathew May
- 2019 Mathew May
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
A javascript module to handle user AJAX actions.
Methods
(static) getModalFooterData(courseId, sectionNum) → {Promise.<Object>}
- Description:
Fetch the footer data for a specific section.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
courseId |
Number | Course ID. |
sectionNum |
Number | Section number. |
Returns:
Promise resolved with the footer data.
- Type
- Promise.<Object>
(inner) activityModules(courseid, sectionnum) → {object}
- Description:
Fetch all the information on modules we'll need in the activity chooser.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
courseid |
Number | What course to fetch the modules for |
sectionnum |
Number | What course section to fetch the modules for |
Returns:
jQuery promise
- Type
- object
(inner) favouriteModule(modName, modID) → {object}
- Description:
Given a module name, module ID & the current course we want to specify that the module is a users' favourite.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
modName |
String | Frankenstyle name of the component to add favourite |
modID |
int | ID of the module. Mainly for LTI cases where they have same / similar names |
Returns:
jQuery promise
- Type
- object
(inner) fetchFooterData(courseid, sectionid) → {object}
- Description:
Fetch all the information on modules we'll need in the activity chooser.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
courseid |
Number | What course to fetch the data for |
sectionid |
Number | What section to fetch the data for |
Returns:
jQuery promise
- Type
- object
(inner) sectionMapper(webServiceData, sectionNum, sectionReturnNum, beforeMod) → {Array}
- Description:
Given the web service data and an ID we want to make a deep copy of the WS data then add on the section num to the addoption URL
- Source:
Parameters:
Name | Type | Description |
---|---|---|
webServiceData |
Object | Our original data from the Web service call |
sectionNum |
Number | The number of the section we need to append to the links |
sectionReturnNum |
Number | null | The number of the section return we need to append to the links |
beforeMod |
Number | null | The ID of the cm we need to append to the links |
Returns:
[modules] with URL's built
- Type
- Array
(inner) unfavouriteModule(modName, modID) → {object}
- Description:
Given a module name, module ID & the current course we want to specify that the module is no longer a users' favourite.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
modName |
String | Frankenstyle name of the component to add favourite |
modID |
int | ID of the module. Mainly for LTI cases where they have same / similar names |
Returns:
jQuery promise
- Type
- object