AdaptFrameworkUtils

adaptframework. AdaptFrameworkUtils

Utilities for use with the AdaptFrameworkModule

Constructor

new AdaptFrameworkUtils()

Source:

Methods

(async, static) getHandler(req, res, next) → {Promise}

Source:
Handles GET requests to the API
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function
Returns:
Type
Promise

(static) getImportContentCounts(content) → {Object}

Source:
Returns a map of content types and their instance count in the content JSON
Parameters:
Name Type Description
content Object Course content
Returns:
Type
Object

(static) getPluginUpdateStatus(versions, isLocalInstall, updatePlugins) → {String}

Source:
Determines the update status code
Parameters:
Name Type Description
versions Array
isLocalInstall Boolean
updatePlugins Boolean
Returns:
The update status code
Type
String

(async, static) getUpdateHandler(req, res, next) → {Promise}

Source:
Handles GET /update requests to the API
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function
Returns:
Type
Promise

(async, static) handleImportFile(req, res) → {Promise}

Source:
Deals with an incoming course (supports both local zip and remote URL stream)
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
Returns:
Type
Promise

(async, static) importHandler(req, res, next) → {Promise}

Source:
Handles POST /import requests to the API
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function
Returns:
Type
Promise

(static) inferBuildAction(req) → {String}

Source:
Infers the framework action to be executed from a given request URL
Parameters:
Name Type Description
req external:ExpressRequest
Returns:
Type
String

(async, static) postHandler(req, res, next) → {Promise}

Source:
Handles POST requests to the API
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function
Returns:
Type
Promise

(async, static) postUpdateHandler(req, res, next) → {Promise}

Source:
Handles POST /update requests to the API
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function
Returns:
Type
Promise

(async, static) retrieveBuildData(id) → {Promise}

Source:
Retrieves metadata for a build attempt
Parameters:
Name Type Description
id String ID of build document
Returns:
Type
Promise

(static) toBoolean(val) → {Boolean}

Source:
Converts a body value to a valid boolean
Parameters:
Name Type Description
val *
Returns:
Type
Boolean

Type Definitions

getImportSummary

Source:
Properties:
Name Type Description
title String Course title
courseId String Course _id
statusReport Object Status report
Properties
Name Type Description
info Object.<String> Information messages
warn Array.<String> Warning messages
content Object Object mapping content types to the number of items of that type found in the imported course
versions Object A map of plugins used in the imported course and their versions
Type:
  • AdaptFrameworkImportSummary
Example
{
  adapt_framework: [1.0.0, 2.0.0],
  adapt-contrib-vanilla: [1.0.0, 2.0.0]
}