ContentModule

content. ContentModule

Module which handles course content

Constructor

new ContentModule()

Source:

Extends

  • AbstractApiModule

Methods

(async) clone(userId, _id, _parentId, customData) → {Promise}

Source:
Recursively clones a content item
Parameters:
Name Type Description
userId String The user performing the action
_id String ID of the object to clone
_parentId String The intended parent object (if this is not passed, no parent will be set)
customData Object Data to be applied to the content item
Returns:
Type
Promise

(async) delete()

Source:

(async) getDescendants(rootItem) → {Array.<Object>}

Source:
Finds all descendant content items for a given root
Parameters:
Name Type Description
rootItem Object The root item document
Returns:
Array of content items
Type
Array.<Object>

(async) getSchema()

Source:

(async) getSchemaName()

Source:

(async) handleClone(req, res, next) → {Promise}

Source:
Request handler for cloning content items
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function
Returns:
Resolves with the cloned data
Type
Promise

(async) handleInsertRecursive(req, res, next)

Source:
Special request handler for bootstrapping a new content object with dummy content
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) init()

Source:

(async) insert()

Source:

(async) insertRecursive(req)

Source:
Creates a new parent content type, along with any necessary children
Parameters:
Name Type Description
req external:ExpressRequest

(async) setValues()

Source:

(async) update()

Source:

(async) updateEnabledPlugins(item, options) → {Promise}

Source:
Maintains the list of plugins used in the current course
Parameters:
Name Type Description
item Object The updated item
options Object
Properties
Name Type Description
forceUpdate Boolean Forces an update of defaults regardless of whether the _enabledPlugins list has changed
Returns:
Type
Promise

(async) updateSortOrder(item, updateData) → {Promise}

Source:
Recalculates the _sortOrder values for all content items affected by an update
Parameters:
Name Type Description
item Object The existing item data
updateData Object The update data
Returns:
Type
Promise