Extensions/Authoring/requiredTags

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

--

Validates that all required tags are present before publishing an item.

Parameters:
NameTypeAttributesDescription
optionsobject<optional>

Object of configuration options.

Properties
NameTypeAttributesDescription
headingstring<optional>

The heading for the error dialog. Defaults to "Required tag{s} missing".

headingLevelnumber<optional>

The heading level for the error dialog. Defaults to 3.

messageStartstring<optional>

The start of the error message. Defaults to "Please add the following tag{s} before publishing:".

messageEndstring<optional>

The end of the error message. Defaults to "".

requiredTagsarray<optional>

The list of required tags. Defaults to [].

Example
const options =  {
    heading: 'Required tag{s} missing',
    headingLevel: 3,
    messageStart: 'Please add the following tag{s} before publishing:',
    messageEnd: '',
    requiredTags: [],
}

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