Extensions/Authoring/dynamicContent

Extensions add specific functionality to Learnosity APIs. They rely on modules within LT being available.

--

Adds an interactive table for users to author dynamic content. Users can also upload a file to populate the table, and export any data to work on it locally.

Supported file types for import: csv, xls, xlsx, ods, and txt.

Parameters:
NameTypeAttributesDescription
optionsobject<optional>

Object of configuration options.

Properties
NameTypeAttributesDescription
maxTabsnumber<optional>

Maximum number of tabs allowed.

useElementCacheboolean<optional>

Whether to use element caching.

labelsobject<optional>

Custom labels for the UI.

Properties
NameTypeAttributesDescription
btnContinuestring<optional>

Text for the continue button.

csvUploadHelpstring<optional>

Help text for CSV upload.

headerValidationHelpstring<optional>

Help text for header validation.

Example
const options = {
    labels: {
        btnContinue: 'Confirm',
        csvUploadHelp: `Add dynamic data to your item by typing directly into the table below. Or, import a file
            (csv, xls, xlsx, ods, and txt are supported).`,
        headerValidationHelp: `The header row must contain only lowercase letters, numbers, and underscores.
            Hyphens are not allowed.`,
    },
}

LT.init(authorApp, {
    extensions: [
        { id: 'dynamicContent', args: options },
    ],
});