Initialization
This article details the properties that are passed as parameters to the window.LearnosityAuthor.init() method to initialize Author API.
This method is the starting point to initializing and rendering Author API, and as you can see in the example below, takes three key parameters.
The Initialization object is mandatory. Further detail on getting started and initializing Author API can also be found in the Quick Start guide.
Example
var initializationObject = {
"security": {
"consumer_key": "INSERT_CONSUMER_KEY_HERE",
"domain": "my.domain.com",
"timestamp": "20120202-1234",
"signature": "SHA256-HASH - See Security"
},
"request": {
"mode": "item_edit",
"reference": "my-item-reference",
"config": {
"global": {
"disable_onbeforeunload": true,
// All tags of type "internal_category_uuid" are hidden in the UI
"hide_tags":
[
{
"type": "internal_category_uuid"
}
]
},
"item_edit": {
"item": {
"back": true,
"columns": true,
"answers": true,
"scoring": true,
"reference": {
"edit": false,
"show": false,
"prefix": "LEAR_" // The reference for a new item will start with LEAR_
},
"save": true,
"status": false,
"dynamic_content": true,
"shared_passage": true
},
"widget": {
"delete": false,
"edit": true
}
},
"item_list": {
"item": {
"status": true,
"url": "http://myApp.com/items/:reference/edit"
},
"toolbar": {
"add": true,
"browse": {
"controls": [
{
"type": "hierarchy",
"hierarchies": [
{
"reference": "CCSS_Math_Hierarchy",
"label": "CCSS Math"
},
{
"reference": "CCSS_ELA_Hierarchy",
"label": "CCSS ELA"
},
{
"reference": "Demo_Items_Hierarchy",
"label": "Demo Items"
}
]
},
{
"type": "tag",
"tag": {
"type": "difficulty",
"label": "Difficulty"
}
},
{
"type": "tag",
"tag": {
"type": "content_provider",
"label": "Source"
}
}
]
}
},
"filter": {
"restricted": {
"current_user": true,
"tags": {
"all": [
{
"type": "Alignment",
"name": ["def456", "abc123"]
},
{
"type": "Course"
}
],
"either": [
{
"type": "Grade",
"name": "4"
},
{
"type": "Grade",
"name": "5"
},
{
"type": "Subject",
"name": ["Math", "Science"]
}
],
"none": [
{
"type": "Grade",
"name": "6"
}
]
}
}
}
},
"dependencies": {
"question_editor_api": {
"init_options": {}
},
"questions_api": {
"init_options": {}
}
},
"widget_templates": {
"back": true,
"save": true,
"widget_types": {
"default": "questions",
"show": true
}
},
"container": {
"height": "auto",
"fixed_footer_height": 0,
"scroll_into_view_selector": "body"
},
"label_bundle": { // German translation and date/time format changes
// Generic components and partials
"backButton": "Zurück",
"loadingText": "Wird geladen",
"modalClose": "Schließen",
"saveButton": "Speichern",
"duplicateButton": "Duplikat",
// itemList > dates (using Moment.js)
"dateTimeLocale": "",
"toolTipDateTimeSeparator": "um",
"toolTipDateFormat": "DD-MM-YYYY",
"toolTipTimeFormat": "HH:MM:SS",
}
},
}
}
var callbacks = {
"readyListener": function () {
console.log("Learnosity Author API is ready");
},
"errorListener": function (e) {
//callback to occur on error
console.log("Error code ", e.code);
console.log("Error message ", e.message);
console.log("Error name ", e.name);
console.log("Error name ", e.title);
}
};
var authorApp = LearnosityAuthor.init(initializationObject, callbacks);
Initialization
The Initialization
object is a JSON object which is passed as the first parameter into
the window.LearnosityAuthor.init() method. It includes all the information needed to initialize the API.
It contains the following two top-level properties:
Security Object
The Security object is a property generated by the Learnosity server-side SDKs to ensure that the APIs are only initialized from a secured, allowed source, using your consumer key and secret.
This is handled by our SDKs in:
For other languages, please see our Security & Authentication page on how to sign your requests.
Request Object
The request object contains all of configuration properties of authoring items and activities as well as user identification
Properties= mandatory property
- activity_edit: configuration for
activity_edit
mode - activity_list: configuration for
activity_list
mode - container: configuration for Author API container
- dependencies: configuration for Author API dependencies including QuestionEditor API and Questions API
- global: global configuration
- item_edit: configuration for
item_edit
mode - item_list: configuration for
item_list
mode - label_bundle: configuration to override labels in Author API
- widget_templates: configuration for widget templates
Properties: | |
---|---|
activity_edit |
Type:
object Hold configuration for the Activity edit view.
|
activity_list |
Type:
object Hold configuration for the Activity list view. |
container |
Type:
object Holds configuration for the Author API container. |
dependencies |
Type:
object Holds configuration for the dependencies. |
global |
Type:
object Holds configuration for global settings. |
item_edit |
Type:
object Holds configuration for the Item edit view. |
item_list |
Type:
object Holds configuration for the Item list view. |
label_bundle |
Type:
object Holds optional overrides for each label in the API.
Each label has a default English value (shown in the example JSON), and any labels omitted from the label_bundle object will use that default value.See article on Internationalization for more information. |
widget_templates |
Type:
object Holds configuration for the Widget template view. |
configactivity_edit
objectProperties: | |
---|---|
activity_preview |
Type:
object Holds configuration for the Activity preview view. |
adaptive_fields |
Type:
object Holds configuration for the seeding exposure, operational exposure, and items average difficulty fields of an activity. |
annotations |
Type:
object Holds the configuration for the customization of Annotations API modules in Assessment player. |
back |
Type:
boolean Controls whether back button is shown. Note Setting both back and save.show to boolean false will hide the navigation bar. |
difficulty |
Type:
object Holds configuration for the difficulty field of an activity. |
duplicate |
Type:
object Holds the configuration for the Activity duplication behavior. |
default_player_template |
Type:
string Represents the player template which is selected by default when creating a new Activity. Reference can be either a preconfigured or custom template. Preconfigured template references can be found by inspecting the DOM element of the selection button, or by searching the DOM for [data-authorapi-player-reference] .If no value is provided or the provided reference does not exist in the drop-down menu (default, or as specified in player_templates ), the default value is the first option in the drop-down menu. |
customize_presets |
Type:
object Holds configuration for the customization of player template presets. |
override_labels |
Type:
object Holds configuration for the customization of Assess API labels. |
enabled_player_templates |
Type:
array Holds an array of player template references (both preconfigured, and custom as defined in player_templates ).Use this to specify which templates should be displayed in the Player Tab of the Activity editor, and how they will be ordered. This can be used to hide default templates and show only custom ones, or alternatively hide the entire selection area by passing an empty array. Note Template references are case sensitive.
Default: contains all preconfigured templates, and all templates from |
item |
Type:
object Holds configuration for the Items tab inside the Activity edit view. |
item_search |
Type:
object Holds configuration for the Item lookup screens (Item picker, intro and outro picker views) used by the Activity editor. Important If a filter is specified for item list and none for item search, the item list filter will be applied. |
item_title |
Type:
object Holds configuration for the Item title in the Activity edit view. |
mode |
Type:
object Holds configuration for the Activity edit mode buttons. |
player |
Type:
object Holds configuration for the Activity player settings. |
player_templates |
Type:
Array[PlayerTemplateObject] Holds custom assess player templates for authors to select from in the Activity editor. An assess player template is a defined set of Assess API config options which will be used to display the Activity. Custom assess player templates specified here will be included in the list of preconfigured templates available on the Player tab of the Activity editor. Each array object represents a custom player template.
Default: |
player_template_builder |
Type:
object Holds configuration for the Activity player template builder. |
reference |
Type:
object Holds configuration for the Activity reference. |
save |
Type:
object Holds configuration for the Activity save behavior. |
status |
Type:
object Holds configuration for the Activity status. |
source |
Type:
boolean Controls whether the source tab is shown.
Default: |
tags |
Type:
object Holds configuration for the Activity tags. |
tags_on_create |
Type:
Array[object] Holds Tag objects which are added to a new Activity when saved. A maximum of 50 Tags are allowed. Note Tag types defined in hide_tags and tags_on_create will be saved but not displayed in the UI.
Default: See knowledge base article on Tag formats for more information.
|
title |
Type:
object |
resource_item |
Type:
object Holds configuration for the Resource Item picker. |
configactivity_editactivity_preview
objectProperties: | |
---|---|
item |
Type:
object Holds configuration for the Items within the Activity preview view.
|
configactivity_editactivity_previewitem
objectProperties: | |
---|---|
reference |
Type:
object Holds configuration for the reference of items within the Activity preview view.
|
configactivity_editactivity_previewitemreference
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether Item references are shown in the Activity preview panels. In the "Player" tab, Item references will be shown top left of the player. In the "List" tab, Item references will be shown above each Item.
Default: |
configactivity_editadaptive_fields
objectVersion added: v2021.3.LTS
Properties: | |
---|---|
show |
Type:
boolean Controls whether the seeding exposure, operational exposure, and items average difficulty fields of an activity are shown. Note These fields are read-only.
Default: |
configactivity_editannotations
objectProperties: | |
---|---|
enable |
Type:
boolean If set to true, the author is given the ability to enable and disable Annotations API modules for the Assessment player. Note that customize_presets.enable option must be true else the customization area will be hidden.
Default: |
configactivity_editdifficulty
objectVersion added: v2021.2.LTS
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the difficulty of an activity can be changed. Maximum difficulty is 10,000.
Default: |
show |
Type:
boolean Controls whether the difficulty of an activity is shown.
Default: |
configactivity_editduplicate
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the duplicate button is shown.
Default: |
deep_copy |
Type:
boolean Controls whether the user will be presented with the option to duplicate or share the Items and content of the Activity.
Default: |
duplicate_shared_passages |
Type:
boolean If deep_copy is enabled, setting this to true will give the author the option to share or duplicate shared passages.
Default: |
configactivity_editcustomize_presets
objectProperties: | |
---|---|
enable |
Type:
boolean If set to true the author is given the ability to customize the region presets.
Default: |
configactivity_editoverride_labels
objectProperties: | |
---|---|
enable |
Type:
boolean If set to true the author is given the ability to customize Assess API's default labels.
Default: |
configactivity_edititem
objectProperties: | |
---|---|
add |
Type:
object Holds configuration for the "Create Item" button. |
edit |
Type:
object Holds configuration for Item editing from within the Activity edit view. |
status |
Type:
object Holds configuration for Item status within the Activity edit view. |
title |
Type:
object Holds configuration for the Item title in the Activity edit view. |
configactivity_edititemadd
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the "Create Item" button is visible.
Default: |
configactivity_edititemedit
objectProperties: | |
---|---|
allow |
Type:
boolean Controls whether Item editing is allowed in the Activity edit view. If this is true and the author has the correct permissions, Item titles or references (depending on which is shown) in the Items tab will be clickable. Clicking on it takes the user to the Item edit view. If this is true but the author doesn't have the correct permissions, a read-only icon will be displayed next to the Item title or reference instead.
Default: |
configactivity_edititemstatus
objectProperties: | |
---|---|
show |
Type:
boolean Controls visibility of Item status in the Activity edit view.
Default: |
configactivity_edititemtitle
objectVersion added: v2021.2.LTS
Properties: | |
---|---|
show |
Type:
boolean Controls whether Item titles are visible in the Activity edit view.
When enabled, the Item title or "Untitled" will be displayed. When disabled, the reference will be shown. Note Setting activity_edit.item_title.show to true will also show Item titles in the Activity edit view.
Default: |
show_reference |
Type:
boolean Controls whether Item references are visible in the Activity edit view.
When enabled with title.show set to true , the Item references will be shown in addition to Item titles.
Default: |
configactivity_edititem_search
objectImportant If a filter is specified for item list and none for item search, the item list filter will be applied.
Properties: | |
---|---|
back |
Type:
boolean Controls whether the "back" button is shown.
Default: |
filter |
Type:
object Options for filtering and restricting content that is displayed on the Item lookup screens. |
item_banks |
Type:
Array[ItemBankDefinition] An optional array of Item banks from where Items for Activities can be loaded. If no item_banks are specified, all Items are loaded from the default Item bank.See Knowledge base article on multi Item bank access for more information. |
limit |
Type:
number Control the number of Items listed on each page in the Item picker, intro and outro picker views. Valid value is an integer between 1 and 50.
Default: |
show |
Type:
boolean Controls whether the "Find Items" button is shown in the Activity edit view.
Default: |
sort |
Type:
boolean Controls whether the sort option is shown.
Default: |
title |
Type:
object Holds configuration for the Item title in the Item picker, intro and outro picker views. |
toolbar |
Type:
object Holds configuration options for the search toolbar. |
configactivity_edititem_searchfilter
objectProperties: | |
---|---|
restricted |
Type:
object Holds config for filters which are applied by default to the search criteria for the Item lookup results. Use this to restrict what items users can see, as these cannot be changed by the user. |
configactivity_edititem_searchfilterrestricted
objectProperties: | |
---|---|
created_by |
Type:
array Only display Items created by the users in the passed array of strings (based on their user.id ).A maximum of 50 string values are allowed.
Default: |
current_user |
Type:
boolean Only display Items created by the current user (based on their user.id ), if created_by is present, this option overrides created_by .
Default: |
tags |
Type:
object Holds config for tag filters which are applied by default to the search criteria for the Item lookup results. |
Properties: | |
---|---|
all |
Type:
array Each entry in the tags.all array is an object.This object can follow three formats, the first being the TagsV2 object format where it only has the type and name properties.It can also follow a variation of the said format where the name attribute is instead an array of strings which makes it more convenient to specify multiple tags of the same type.
For these two formats, Items must have all the specified tags to be visible. The last format is another variation of the first one where the name property is omitted leaving the object with just the type property.
In this case, Items must have at least one tag of the given type to be visible.If there is more than one entry in tags.all , Items are only displayed if they have all of the tags specified for each entry in this initialization option.See knowledge base article on advanced tag search for more information. |
either |
Type:
array Each entry in the tags.either array is an object.This object can follow the TagsV2 object format where it only has the type and name properties.It can also follow a variation of the said format where the name property is instead an array of strings which makes it more convenient to specify multiple tags of the same type.Items are only displayed if they have at least one of the tags specified for at least one entry in this initialization option. Note tags.either only supports an array of TagsV2 objects, not arrays of TagsV2 objects.See knowledge base article on advanced tag search for more information. |
none |
Type:
array Each entry in the tags.none array is an object.This object can follow the TagsV2 object format where it only has the type and name properties.It can also follow a variation of the said format where the name property is instead an array of strings which makes it more convenient to specify multiple tags of the same type.Items are only displayed if they don't have each tag specified for each entry in this initialization option. Note For performance reasons, this initialization option will only work if tags.all or tags.either are set as well. If that's not the case, tags.none will be ignored. See knowledge base article on advanced tag search for more information. |
configactivity_edititem_searchtitle
objectVersion added: v2021.2.LTS
Properties: | |
---|---|
show |
Type:
boolean Controls whether Item titles are visible in the Item picker, intro and outro picker views.
When enabled, the Item title or "Untitled" will be displayed. When disabled, the reference will be shown. Note Setting activity_edit.item_title.show to true will also show Item titles in the Item picker, intro and outro picker views.
Default: |
show_reference |
Type:
boolean Controls whether Item references are visible in the Item picker, intro and outro picker views.
When enabled with title.show set to true , the Item references will be shown in addition to Item titles.
Default: |
configactivity_edititem_searchtoolbar
objectProperties: | |
---|---|
search |
Type:
object Holds configuration options for the search toolbar. |
configactivity_edititem_searchtoolbarsearch
objectProperties: | |
---|---|
show |
Type:
boolean Determines if the search interface is displayed.
Default: |
controls |
Type:
array Specifies search options. Possible values for the array are reference , content and title . title is only allowed if items are configured to display their title. reference is only allowed if title is disabled or activity_edit.item_search.title.show_reference is enabled when title is enabled.
Default: |
widget_type |
Type:
boolean Determines if search by widget type is available.
Default: |
tags |
Type:
object Contains options for the tag search. |
configactivity_edititem_searchtoolbarsearchtags
objectProperties: | |
---|---|
show |
Type:
boolean Determines if search by tags is available.
Default: |
configactivity_edititem_title
objectVersion added: v2021.2.LTS
Properties: | |
---|---|
show |
Type:
boolean
Deprecated
Use
Controls whether the Item title is shown in the Activity edit view.
Default: |
configactivity_editmode
objectProperties: | |
---|---|
default |
Type:
string Default Activity edit mode, valid values are: edit , preview (case sensitive).
Default: |
show |
Type:
boolean Controls whether the mode buttons are shown. Note Setting both mode.show and reference.show to boolean false will hide the entire toolbar.
Default: |
configactivity_editplayer
objectProperties: | |
---|---|
administration |
Type:
object Holds configuration for the Activity administration settings. |
playback |
Type:
object Holds configuration for the Activity player settings. |
scoring |
Type:
object Holds configuration for the Activity scoring settings. |
text |
Type:
object Holds configuration for the Activity text settings. |
time |
Type:
object Holds configuration for the Activity time settings. |
configactivity_editplayeradministration
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the administration settings are shown.
Default: |
show_exit |
Type:
object Holds configuration for the "Exit & discard" option. |
show_extend |
Type:
object Holds configuration for the "Extend Activity time" option. |
show_save |
Type:
object Holds configuration for the "Save & exit" option. |
configactivity_editplayeradministrationshow_exit
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayeradministrationshow_extend
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayeradministrationshow_save
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplayback
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the player settings are shown.
Default: |
distractor_rationale |
Type:
object Holds configuration for the "Show Distractor Rationale per question" option. |
distractor_rationale_response_level |
Type:
object Holds configuration for the "Show Distractor Rationale per response" option. |
scroll_to_top |
Type:
object Holds configuration for the "Scroll to top on Item change" option. |
scrolling_indicator |
Type:
object Holds configuration for the "Show scrolling indicator" option. |
show_acknowledgements |
Type:
object Holds configuration for the "Show acknowledgements" option. |
shuffle_items |
Type:
object Holds configuration for the "Shuffle order of items" option. |
skip_submit_confirmation |
Type:
object Holds configuration for the "Display confirmation window on submission" option. |
submit_criteria |
Type:
object Holds configuration for the "Allow submission" option. |
warning_on_change |
Type:
object Holds configuration for the "Warn student on unattempted question(s)" option. |
configactivity_editplayerplaybackdistractor_rationale
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybackdistractor_rationale_response_level
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybackscroll_to_top
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybackscrolling_indicator
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybackshow_acknowledgements
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybackshuffle_items
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybackskip_submit_confirmation
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybacksubmit_criteria
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerplaybackwarning_on_change
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayerscoring
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the scoring settings are shown.
Default: |
client_side_scoring |
Type:
object Holds configuration for the "Allow player side scoring" option. |
configactivity_editplayerscoringclient_side_scoring
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayertext
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the text settings are shown.
Default: |
font_size |
Type:
object Holds configuration for the font size option. |
configactivity_editplayertextfont_size
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayertime
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the time settings are shown.
Default: |
auto_save |
Type:
object Holds configuration for the "Auto save at intervals of n seconds" option. |
idle_timeout |
Type:
object Holds configuration for the "Trigger inactivity timeout warning" option. |
limit_type |
Type:
object Holds configuration for the "Force submit" option. |
reading_mode |
Type:
object Holds configuration for reading mode related options. |
warning_time |
Type:
object Holds configuration for the "Warn when approaching end of activity" option. |
configactivity_editplayertimeauto_save
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
ui |
Type:
object Holds configuration for the "Enable a visual indicator" option. |
Properties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayertimeidle_timeout
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
countdown_time |
Type:
object Holds configuration for the "Allow student to dismiss timeout warning" option. |
configactivity_editplayertimeidle_timeoutcountdown_time
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayertimelimit_type
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayertimereading_mode
objectProperties: | |
---|---|
goto_first_item_on_reading_time_completion |
Type:
object Holds configuration for the "Go to first item on reading time completion" option. |
warning_time |
Type:
object Holds configuration for the "Warn when approaching end of reading time" option. |
configactivity_editplayertimereading_modegoto_first_item_on_reading_time_completion
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayertimereading_modewarning_time
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayertimewarning_time
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the option is shown.
Default: |
edit |
Type:
boolean Controls whether the option can be changed.
Default: |
configactivity_editplayer_template_builder
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the player template builder is shown. This allows users to create and edit player templates. Note: This does not allow customization of player templates provided via the player_templates init option.
Default: |
configactivity_editreference
objectProperties: | |
---|---|
edit |
Type:
boolean Controls whether the reference can be changed.
Default: |
show |
Type:
boolean Controls whether the reference is shown. Note Setting both reference.show and mode.show to boolean false will hide the entire toolbar.
Default: |
configactivity_editsave
objectProperties: | |
---|---|
persist |
Type:
boolean Controls whether the Activity data is persisted in Activity bank.
Default: |
show |
Type:
boolean Controls whether the save button is shown. Note Setting both save.show and back to boolean false will hide the entire toolbar.
Default: |
configactivity_editstatus
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the status drop-down menu is shown.
Default: |
configactivity_edittags
objectProperties: | |
---|---|
edit |
Type:
boolean Controls if authors can edit tags for the activity.
Default: |
show |
Type:
boolean Controls whether the tags tab is shown in the Activity edit view.
Default: |
configactivity_edittags_on_create
Array[object]A maximum of 50 Tags are allowed.
Note Tag types defined in
hide_tags
and tags_on_create
will be saved but not displayed in the UI.See knowledge base article on Tag formats for more information.
Types | |||||||
---|---|---|---|---|---|---|---|
object |
|
"tags_on_create": [
{
"type": "Subject",
"name": "Math"
},
{
"type": "Grade",
"name": "Grade 9"
}
]
configactivity_edittitle
objectProperties: | |
---|---|
edit |
Type:
boolean Controls whether the Activity title can be changed.
Default: |
mandatory |
Type:
boolean Controls whether a title is required when saving an Activity. The mandatory option requires both title.show and title.edit to be true .
Default: |
show |
Type:
boolean Controls whether the Activity title is shown. If true , the Activity reference will not be shown and reference.show and reference.edit are ignored.Note that the navigate search parameter when using Activity titles is titleOrReferenceOrDescription instead of referenceOrDescription , which will be ignored.
Default: |
configactivity_editresource_item
objectProperties: | |
---|---|
show |
Type:
boolean Controls whether the Resource Item toggle is visible in the Activity edit screen.
Default: |
configactivity_list
objectProperties: | |
---|---|
filter |
Type:
object Controls which Activities are to be displayed and can be accessed by users.
|
limit |
Type:
integer Control the number of Activities listed on each page in the Activity list view. Valid value is an integer between 1 and 50.
Default: |
status |
Type:
boolean Controls whether the Activity status is shown in the Activity list view.
Default: |
title |
Type:
object Holds configuration for the Activity title in the Activity list view. |
toolbar |
Type:
object Holds configuration for the Activity list (search) toolbar. |
configactivity_listfilter
objectProperties: | |
---|---|
restricted |
Type:
object Specifies a filter which cannot be changed by the user. Important If a tag filter is specified and a user should be allowed to create Activities, tags matching that filter will need to be set on Activity creation (using setActivityTags ).
|
"filter": {
"restricted": {
"tags": {
"all": [
{
"type": "Depth of Knowledge",
"name": "1"
}
]
}
}
}
configactivity_listfilterrestricted
objectImportant If a tag filter is specified and a user should be allowed to create Activities, tags matching that filter will need to be set on Activity creation (using
setActivityTags
).
Properties: | |
---|---|
created_by |
Type:
array Only display Activities created by the users in the passed array of strings (based on their user.id ).
Default: |
current_user |
Type:
boolean Only display Activities created by the current user (based on their user.id ), if created_by is present, this option overrides created_by .
Default: |
status |
Type:
array Only display Activities that have a status matching one of the statuses in the array.
Valid statuses are published , unpublished , archived .
Default: |
tags |
Type:
object Holds config for tag filters which are applied by default to the search criteria for the Activity list results. |
configactivity_listfilterrestrictedtags
objectProperties: | |
---|---|
allow_filtered_tags_overwrite |
Type:
boolean If set to true, then a user can save Activities which do not have the tags required by the tag filters below.
Default: |
all |
Type:
array Each entry in tags.all is an object. The object can either have only a "type" attribute, meaning that all Activities must have at
least one tag of the given type. Or the object can have a "type" and "name" attribute meaning that all Activities must have all the specified tags.If several entries are specified in tags.all , Activity must have all those tags to be visible.
Default: See knowledge base article on advanced tag search for more information. |
either |
Type:
array Each entry in tags.either is an object with a "type" and "name".
Activities must have one of the specified either tags to be displayed.Note If this contains a pair of tags that was also set in tags.all , then tags.all takes precedence.
Default: See knowledge base article on advanced tag search for more information. |
none |
Type:
array Each entry in tags.none is an object with a "type" and "name".
Activities are only displayed, if they don't have any of the tags.none tags.Note For performance reasons, tags.none tags are only allowed if tags.all or tags.either tags are specified as well.
If that's not the case, the none tags will be ignored.Note If this contains a pair of tags that was also set in tags.all or tags.either , then tags.none takes precedence.
Default: See knowledge base article on advanced tag search for more information. |
configactivity_listtitle
objectVersion added: v2021.2.LTS
Properties: | |
---|---|
show |
Type:
boolean Controls whether Activity titles are visible in the Activity list view.
When enabled, the Activity title or “Untitled” will be displayed. When disabled, the reference will be shown.
Default: |
show_reference |
Type:
boolean Controls whether Activity references are visible in the Activity list view.
When enabled along with title.show set to true , the Activity references will be shown in addition to Activity titles.
Default: |
configactivity_listtoolbar
objectProperties: | |
---|---|
search |
Type:
boolean Controls whether the main search button is shown.
Default: |
add |
Type:
boolean Controls whether the create new activity button is shown.
Default: |
add_adaptive |
Type:
boolean Controls whether the create adaptive activity button is shown. When both config.activity_list.toolbar.add and config.activity_list.toolbar.add_adaptive are true , the create activity button will contain a dropdown menu for creating adaptive activities.When config.activity_list.toolbar.add is true and config.activity_list.toolbar.add_adaptive is false , the create activity button will not contain a dropdown menu for creating adaptive activities.When config.activity_list.toolbar.add is false , regardless of the value of config.activity_list.toolbar.add_adaptive , both the create activity button and the create adaptive activity drop down menu will not be displayed.
Default: |
configcontainer
objectProperties: | |
---|---|
fixed_footer_height |
Type:
integer If the height of the container is left as 'auto' and scrolling is enabled then preview mode
will accommodate all the space to the bottom of a viewport. There are cases though, when a
host page may use a footer with position set to fixed. Such footer will cover bottom part of
the preview mode making it inaccessible. Specifying a height of the footer will let a preview
mode to adjust its height accordingly. This is the height from the bottom edge of div.lrn-author-item-content to the bottom edge of the bottom element (footer) in the page. Integer value corresponds to pixels.
Default: |
height |
Type:
integer The height of Author API app is automatic, which means the more content is there, the more it grows.
Except in a preview mode where scrolling is enabled, the height of the container of Author API
will be adjusted and will fit exactly within specified height to expose how scrolling functionality works.
It's in particular very useful when loading Author API in fixed size modal window. Setting this sets the height of the Author API container in Item edit/preview mode when "Enable scrolling for long content" is ticked in the Item settings view only. Integer value corresponds to pixels.
Default: |
scroll_into_view_selector |
Type:
string When navigating between views (e.g. from Item edit to Question edit view),
Author API scrolls its main container into view by default. If you want Author API to scroll another container
into view, you can define that container's selector (as a jQuery selector) here. In Author Site,
this is set to 'body' so that Author API is not partially hidden by Author Site's navigation bar. This only affects the following transitions:
|
configdependencies
objectconfigdependenciesquestion_editor_api
objectProperties: | |
---|---|
init_options |
Type:
object The initialization options for the instance of Question Editor API that will be used. Do not set Questions API config in question_editor_api.init_options.dependencies object as it will not be used.
Instead set questions_api.init_options config.
Default: |
preload |
Type:
boolean If true , load Question Editor API when Author API is first loaded.If false, load Question Editor API when the author visits the Item edit page (I.e. when QE is needed).
Default: |
configdependenciesquestions_api
objectProperties: | |
---|---|
init_options |
Type:
object The initialization options for the instance of Questions API that will be used.
Default: |
configglobal
objectProperties: | |
---|---|
ab_standards |
Type:
object Holds the configuration for the integration of Academic Benchmarks / AB Connect. |
disable_onbeforeunload |
Type:
boolean If set to true , the HTML DOM onbefore event is not listened to by Author API.One example is that no alert will be shown if an Item, Activity or Question was modified (but not saved) and the user refreshes the page. The alert is still shown if you click back/change the URL.
Default: |
hide_tags |
Type:
array Tag types defined in hide_tags will not be displayed in Tag suggestions when:
You can only specify hide_tags or show_tags , but not both at the same time.Specify each array entry as a TagSearchByType object. |
items |
Type:
object Holds the configuration for items. |
show_tags |
Type:
array If you define Tag types in show_tags , only Tags of the specified type will be displayed in the Tag suggestions when:
hide_tags or show_tags , but not both at the same time.Specify each array entry as a TagSearchByType object. |
workflow |
Type:
object Holds the configuration for workflows. |
Version added: v2021.3.LTS
Properties: | |
---|---|
enable |
Type:
boolean Controls whether Academic Benchmarks / AB Connect is enabled. Default: false |
aligned_tag_type |
Type:
string Defines what Tag type will be used when a standard is tagged against an Item.
Default: |
tag_standard_hierarchy |
Type:
boolean If true , the hierarchy information of an alignable standard and its ancestor entities of Academic Benchmarks / AB Connect will also be added as Tags to an Item when the alignable standard is added to an Item. This includes all ancestor standards, as well as authority, publication, subject/topic, and section.If false , only the alignable standard will be added to the Item.Default: false |
edit_standards |
Type:
boolean Controls whether standards can be aligned to Items or removed from Items. Default: true |
filter |
Type:
boolean Controls whether filtering by standard is enabled for the Item list and Item lookup screens. Default: true |
Properties: | |
---|---|
read_only |
Type:
object Holds the configuration for read only Items. |
Version added: v2021.1.LTS
Properties: | |
---|---|
enabled |
Type:
boolean If set to true, sets the Items in the Item Bank as read only.
Default: |
filter |
Type:
object Holds the configuration for specifying specific Items as read only. |
Version added: v2021.1.LTS
Properties: | |
---|---|
either |
Type:
array An array of Tag objects in the V2 Format. If specified, only Items containing any of the Tags specified will be rendered in a read only mode. Tags specified in this array should not be used to filter out the items in the item_list mode by using the filter.restricted.tags object or to filter out Tags using the global.show_tags option.
Default: |
duplicate |
Type:
boolean If set to true, the filtered Items in read only mode can be duplicated for editing.
Default: |
Properties: | |
---|---|
item |
Type:
object Holds configuration for workflows for Items. |
Version added: v2020.2.LTS
Properties: | |
---|---|
reference |
Type:
string Reference of the workflow. The specified workflow must be pre-configured by the Learnosity support team. Contact us for details. Note The reference is case insensitive. |
allowed_workflow_states |
Type:
array Optional array containing references of the allowed workflow states. The Item list will automatically be filtered by the provided workflow states. Items in these states can be opened and transitioned to linked states (linked states will be shown regardless of values in allowed_workflow_states ). However, if an Item is in a state not present in allowed_workflow_states , that Item can still be viewed and edited, but its state can not be changed.If this property is omitted, the Item list will not filter by any states. Note State references are case insensitive. |
comments |
Type:
object Holds configuration for Item workflow comments. |
Properties: | |
---|---|
show |
Type:
boolean Controls whether Item workflow comments are shown. Default: true |
add |
Type:
boolean Controls whether Item workflow comments can be added. Default: true |
configitem_edit
objectProperties: | |
---|---|
item |
Type:
object Holds configuration for the Item. |
widget |
Type:
object Holds configuration for each widget (Question/Feature) on an Item. |
settings |
Type:
object Holds configuration for Item settings. |
tags_on_create |
Type:
Array[object] Holds Tag objects which are added to a new Item when saved. A maximum of 50 Tags are allowed. Note Tag types also defined in the hide_tags array will be added on save, but will not displayed in the UI.
Default: See knowledge base article on Tag formats for more information.
|
Properties: | |
---|---|
actions |
Type:
object Holds the configuration for the actions tab of the settings view.
Important
Supported with |
answers |
Type:
boolean Controls whether the "Show Answers" button is displayed in the Item preview view.
Default: |
back |
Type:
boolean Controls whether the back button is shown in the Item edit view.
Default: |
columns |
Type:
boolean Controls whether the preconfigured columns options are shown in the layout tab of the settings view.
Default: |
details |
Type:
object Holds configuration for the details tab of the settings view. |
duplicate |
Type:
object Holds configuration for the item duplication behavior. See knowledge base article on item duplication for more information. |
dynamic_content |
Type:
boolean Controls whether the dynamic content data table tab is shown in the settings view.
Default: |
dynamic_image_tag |
Type:
boolean If set to true, when a URL is added into dynamic data and that URL's MIME type is an image, then the URL will automatically be converted into a HTML <img> element.
Default: |
enable_audio_recording |
Type:
boolean Controls whether audio recording is enabled for the Audio player simple feature. Currently, audio recording is only supported in Chrome, Safari, Firefox and Edge. The host page must also be using HTTPS. HTTP is not supported yet.
Default: |
mode |
Type:
object Holds configuration for the Item edit mode buttons. |
popup_content |
Type:
object Holds configuration for the Pop-up Content plugin. |
reference |
Type:
object Holds configuration for the Item reference. |
save |
Type:
boolean | object Configuration for the Item save behavior. |
scoring |
Type:
boolean Controls whether local scoring is enabled in the Item preview view. Immediately marks the Questions and shows the score to the user.
Default: |
shared_passage |
Type:
boolean Controls whether the "Find existing passage" button is displayed in the add widget button in Item edit view.
Default: |
status |
Type:
boolean Controls whether the Item status is shown in the Item edit view.
Default: |
tabs |
Type:
boolean Controls whether the enable tabs checkboxes are shown in the layout tab in the settings view.
Default: |
tags |
Type:
object Holds configuration for Item level tagging in the Item settings view. |
title |
Type:
object Holds configuration for Item title in the Item edit view. |
Holds the configuration for the actions tab of the settings view.
Important
Supported with rendering_type: "assess"
only.
Properties: | |
---|---|
show |
Type:
boolean Controls whether the actions tab is shown. Default: false |
Properties: | |
---|---|
acknowledgements |
Type:
object Holds configuration for the acknowledgements. |
description |
Type:
object Holds configuration for the description. |
difficulty |
Type:
object Holds configuration for the difficulty. |
note |
Type:
object Holds configuration for the note. |
scoring_type |
Type:
object Holds configuration for the scoring type drop-down menu. |
status |
Type:
object Holds configuration for the status drop-down menu. |
source |
Type:
object Holds configuration for the source. |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the acknowledgements can be changed. Default: true |
show |
Type:
boolean Controls whether the acknowledgements is shown. Default: false |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the description can be changed. Default: true |
show |
Type:
boolean Controls whether the description is shown. Default: true |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the difficulty can be changed. Default: true |
show |
Type:
boolean Controls whether the difficulty is shown. Default: true |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the note can be changed. Default: true |
show |
Type:
boolean Controls whether the note is shown. Default: false |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the scoring type can be changed. Default: true |
show |
Type:
boolean Controls whether the scoring type drop-down menu is shown. Default: true |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the status can be changed. Default: true |
show |
Type:
boolean Controls whether the status drop-down menu is shown. Default: true |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the source can be changed. Default: true |
show |
Type:
boolean Controls whether the source is shown. Default: false |
See knowledge base article on item duplication for more information.
Properties: | |
---|---|
show |
Type:
boolean Controls whether the duplicate button is shown. Default: true |
duplicate_shared_passages |
Type:
boolean Controls whether the user will be presented with the option to duplicate or share passages. Default: false |
Properties: | |
---|---|
default |
Type:
string Default Item edit mode, valid values are: edit , preview (case sensitive).
Default: |
show |
Type:
boolean Controls whether the mode buttons are shown.
Default: |
Version added: This feature will be released in v2023.1.LTS.
Properties: | |
---|---|
enable |
Type:
boolean Controls whether the button is visible on the CKEditor toolbar (in Question Edit view). This button is available only for the Stimulus field (in any Question type), and the Content field in the Shared Passage Question type.Note: When set to false , existing Pop-up Content widgets will still show in the Question Edit view - they just won't be editable (and new ones can't be added).
Default: |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the reference can be changed.
Default: |
prefix |
Type:
string Sets the prefix for a newly created Item's reference. Max length for the prefix is 114 characters. Since the prefix will be prepended to a UUID of 36 characters, the prefix is limited so as not to exceed the maximum Item reference length of 150 characters. New references are generated in a different way if you use Author API within Author Site. If you don't specify a prefix here, Author Site will automatically generate a prefix consisting of the first 4 letters of your organisation's name followed by an underscore '_'. E.g. for Learnosity, the prefix would be 'LEAR_'. The prefix is then concatenated with a UUID to make the reference unique. |
show |
Type:
boolean Controls whether the reference is shown.
Default: |
Types | |||||||
---|---|---|---|---|---|---|---|
boolean | Controls whether the save button is shown on the Item edit view. |
||||||
object | Holds configuration for the save button.
|
Properties: | |
---|---|
edit |
Type:
boolean Controls if authors can edit tags for the item.
Default: |
show |
Type:
boolean Controls whether Item level tagging (Tags tab) is shown in the Item settings view.
Default: |
Properties: | |
---|---|
edit |
Type:
boolean Controls whether the Item title can be changed.
Default: |
mandatory |
Type:
boolean Controls whether a title is required when saving an Item. The mandatory option requires both title.show and title.edit to be true .
Default: |
show |
Type:
boolean Controls whether the Item title is shown. If true , the Item reference will not be shown and reference.show and reference.edit are ignored.
Default: |
Properties: | |
---|---|
delete |
Type:
boolean Controls whether authors are able to delete widgets.
Default: |
edit |
Type:
boolean Controls whether authors are able to edit widgets.
Default: |
Properties: | |
---|---|
show |
Type:
boolean If set to true, the settings button is shown, otherwise, it will be hidden.
Default: |
full_height |
Type:
boolean If set to true, the settings container will occupy the full browser height, otherwise, the height is fixed.
Default: |
A maximum of 50 Tags are allowed.
Note Tag types also defined in the
hide_tags
array will be added on save, but will not displayed in the UI.See knowledge base article on Tag formats for more information.
Types | |||||||
---|---|---|---|---|---|---|---|
object |
|
"tags_on_create": [
{
"type": "Subject",
"name": "Math"
},
{
"type": "Grade",
"name": "Grade 9"
}
]
configitem_list
objectProperties: | |
---|---|
filter |
Type:
object Options for filtering and restricting content that is displayed on the item list view. |
item |
Type:
object Configuration options for each Item row in the item list. |
limit |
Type:
integer Control the number of Items listed on each page in the Item list view. Valid value is an integer between 1 and 50.
Default: |
toolbar |
Type:
object Holds configuration for the Item list (search) toolbar. |
Properties: | |
---|---|
restricted |
Type:
object Holds config for filters which are applied by default to the search criteria for the Item list results. Use this to restrict what items users can see, as these cannot be changed by the user. Important If a tag filter is specified and a user should be allowed to create Items, tags matching that filter will need to be set on Item creation (using the setItemTags public method). You can disable this security feature by setting tags.allow_filtered_tags_overwrite option to true. |
Important If a tag filter is specified and a user should be allowed to create Items, tags matching that filter will need to be set on Item creation (using the
setItemTags
public method). You can disable this security feature by setting tags.allow_filtered_tags_overwrite
option to true.Properties: | |
---|---|
created_by |
Type:
array Only display Items created by the users in the passed array of strings (based on their user.id ).A maximum of 50 string values are allowed.
Default: |
current_user |
Type:
boolean Only display Items created by the current user (based on their user.id ), if created_by is present, this option overrides created_by .
Default: |
status |
Type:
array Only display Items that have a status that matches one of the statuses in the array.
Valid statuses are published , unpublished , archived .
Default: |
tags |
Type:
object Holds config for tag filters which are applied by default to the search criteria for the Item list results. |
configitem_listfilterrestrictedtags
objectProperties: | |
---|---|
allow_filtered_tags_overwrite |
Type:
boolean If set to true, then a user can save Items which do not have the tags required by the tag filters below.
Default: |
all |
Type:
array Each entry in the tags.all array is an object.This object can follow three formats, the first being the TagsV2 object format where it only has the type and name properties.It can also follow a variation of the said format where the name attribute is instead an array of strings which makes it more convenient to specify multiple tags of the same type.For these two formats, Items must have all the specified tags to be visible. The last format is another variation of the first one where the name property is omitted leaving the object with just the type property.
In this case, Items must have at least one tag of the given type to be visible.If there is more than one entry in tags.all , Items are only displayed if they have all of the tags specified for each entry in this initialization option.See knowledge base article on advanced tag search for more information. |
either |
Type:
array Each entry in the tags.either array is an object.This object can follow the TagsV2 object format where it only has the type and name properties.It can also follow a variation of the said format where the name property is instead an array of strings which makes it more convenient to specify multiple tags of the same type.Items are only displayed if they have at least one of the tags specified for at least one entry in this initialization option. Note tags.either only supports an array of TagsV2 objects, not arrays of TagsV2 objects.See knowledge base article on advanced tag search for more information. |
none |
Type:
array Each entry in the tags.none array is an object.This object can follow the TagsV2 object format where it only has the type and name properties.It can also follow a variation of the said format where the name property is instead an array of strings which makes it more convenient to specify multiple tags of the same type.Items are only displayed if they don't have each tag specified for each entry in this initialization option. Note For performance reasons, this initialization option will only work if tags.all or tags.either are set as well. If that's not the case, tags.none will be ignored. See knowledge base article on advanced tag search for more information. |
Properties: | |
---|---|
enable_selection |
Type:
boolean Controls whether a checkbox appears next to the items in the list. When one or more of these checkboxes
are ticked, the items' JSON can be retrieved via public method getSelectedItems
Default: |
status |
Type:
boolean Controls whether the Item status icon is shown in the Item list view.
Default: |
title |
Type:
object Holds configuration for the Item title in the Item list view. |
url |
Type:
string URL used as href for Items in Item list view when opening an Item in a new tab/window. Must contain string ":reference" which will get replaced with the Item reference by Author API.If this is not provided, then links cannot be opened in a new tab/window. |
Version added: v2021.2.LTS
Properties: | |
---|---|
show |
Type:
boolean Controls whether Item titles are visible in the Item list view.
When enabled, the Item title or "Untitled" will be displayed. When disabled, the reference will be shown.
Default: |
show_reference |
Type:
boolean Controls whether Item references are visible in the Item list view.
When enabled along with title.show set to true , the Item references will be shown in addition to Item titles.
Default: |
Properties: | |
---|---|
add |
Type:
boolean Controls whether the create Item button is shown.
Default: |
browse |
Type:
object Holds config options pertaining to the Item list's browse controls. |
search |
Type:
object Holds configuration options for the search toolbar. |
Properties: | |
---|---|
controls |
Type:
Array[TagObject |HierarchyObject |SeparatorObject] Ordered array of browse control objects to render within the browse control part of the toolbar.
The supported types of browse control objects are defined in the toolbar browse controls section. |
configitem_listtoolbarbrowsecontrols
Array[TagObject |HierarchyObject |SeparatorObject]Types | |
---|---|
TagObject | |
HierarchyObject | |
SeparatorObject |
Properties: | |
---|---|
show |
Type:
boolean Determines if the search interface is displayed.
Default: |
controls |
Type:
array Specifies search options. Possible values for the array are reference , content and title . title is only allowed if items are configured to display their title. reference is only allowed if title is disabled or item_list.item.title.show_reference is enabled when title is enabled.
Default: |
widget_type |
Type:
boolean Determines if search by widget type is available.
Default: |
status |
Type:
boolean Determines if search by status is available.
Default: |
tags |
Type:
object Contains options for the tag search. |
Properties: | |
---|---|
show |
Type:
boolean Determines if search by tags is available.
Default: |
configlabel_bundle
objectlabel_bundle
object will use that default value.See article on Internationalization for more information.
Properties: | |
---|---|
dateTimeLocale |
Type:
string Automatically localizes dates and times using Moment.js.
This defaults to an empty string, which Moment.js interprets as "en-us". Values can be passed in by language
(such as "fr" for French), or region and language (such as "en-au" for Australian English). |
toolTipDateFormat |
Type:
string The tooltip date format will automatically be localized when you
set dateTimeLocale, but can be further customized if needed. For more,
see the Moment.js docs on String
+ Format. |
toolTipDateTimeSeparator |
Type:
string Set the separator between the date and time. E.g. setting it to "at" would give "18/12/2017 at 18:39 |
toolTipTimeFormat |
Type:
string The tooltip time format will automatically be localized when you set dateTimeLocale,
but can be further customized if needed. For more, see the Moment.js docs on
String + Format. |
configwidget_templates
objectProperties: | |
---|---|
back |
Type:
boolean Controls whether the back button is shown on the widget edit view (when editing or creating a widget). Setting this to boolean false hides the navigation bar in the tile view.Setting widget_templates.back and widget_templates.save to boolean false hides the entire toolbar bar in widget edit view.
Default: |
require_validation |
Type:
boolean Controls whether an author should add a correct answer to a question prior to saving. This will only be applicable to validatable question types that have "Auto scoring" enabled. Note Currently, this init option is not supported if Question Editor's "Set correct answer(s)" section is hidden. It may be hidden via the editor's custom global template or base question type options.
Default: |
save |
Type:
boolean Controls whether the save button is shown on the widget templates view when editing a widget and upon new widget creation. Setting widget_templates.save and widget_templates.back to boolean false hides the entire toolbar bar in widget edit view.
Default: |
widget_types |
Type:
object Holds configuration for the widget types (Questions and Features) toolbar in the tile view upon new widget creation. |
configwidget_templateswidget_types
objectProperties: | |
---|---|
default |
Type:
string Controls which widget type (Questions or Features) button is selected when first loaded. Valid values are questions and features (case-sensitive).
Default: |
show |
Type:
boolean Controls whether the widget type (Questions and Features) buttons are shown.
Default: |
"item_edit"
"item_list"
"activity_edit"
"activity_list"
item_edit
mode, users cannot navigate to the Item list. Thus, this mode is useful for integrating a custom CMS instead of using Learnosity's.If this is not provided, then the consumer's primary Item Bank will be used.
This will render the Item/Activity list with Items/Activities from requested the Item Bank, allowing Authors to view, create and modify (assuming the consumer has write access) Items/Activities.
item_edit
and activity_edit
modes only, denotes the reference of the Item or Activity you are creating/editing.If the Item or Activity already exists, it will be loaded from the Item bank.
Otherwise, a new item/activity will be created with the provided reference, and will be stored in the Item bank once saved. If using Author API v1.20.0 or later, do not encode the reference by calling
encodeURIComponent
or any other encoding method since Author API already encodes it.Keep track of your Item references and Activity references in your CMS, or use the list view (
item_list
and activity_list
modes) for easier management of Items and Activities.For
item_edit
mode, you can also pass false
(Boolean), will simply initialize Author API without fetching and loading an Item or creating a new Item. The UI will be empty, and a reference can be set later.
Properties: | |
---|---|
email |
Type:
string The email address of the content author. |
firstname |
Type:
string The first name of the content author. |
id |
Type:
string The unique identifier of the content author (case-sensitive). |
lastname |
Type:
string The last name of the content author. |
Properties: | |
---|---|
label |
Type:
string If provided, specifies a label to render in the hierarchy selector drop-down menu for this hierarchy. By default, the hierarchy reference is used as the label. |
reference |
Type:
string Reference of a tag hierarchy to include in the browse control. The specified hierarchy must be pre-configured by the Learnosity support team. Contact us for details. |
Properties: | |
---|---|
hierarchies |
Type:
Array[HierarchyConfig] Array of objects specifying which hierarchies are browsable with this control.
|
type |
Type:
string Determines the type of the browse control to render. Specify "hierarchy" for the hierarchy browse control.
|
Properties: | |
---|---|
type |
Type:
string Determines the type of the browse control to render. Specify "separator" for the separator browse control.
|
Properties: | |
---|---|
type |
Type:
string Determines the type of the browse control to render. Specify "tag" for the tag browse control.
|
tag |
Type:
object Object specifying which tag type is browsable with this control.
|
TagObjecttag
objectProperties: | |
---|---|
label |
Type:
string If provided, specifies the label to render for the tag control. By default, the tag type is used.
|
type |
Type:
string Tag type on which the drop-down menu control should operate.
|
Properties: | |
---|---|
organisation_id |
Type:
number Specifies the organisation from which the Items are loaded |
item_bank_name |
Type:
string The name of the Item bank displayed by Author API |
item_pool_id |
Type:
string The id of the Item pool from which Items are loaded |
filter |
Type:
object A specific filter for the Item bank. The specification of the filter is the same as the Item search root filter
|
Properties: | |
---|---|
labelBundle |
Type:
object Specifies label bundle config to pass to Assess API. Assess API's default label bundle will be used if not specified. See full documentation on Assess API's label bundle for more information. |
name |
Type:
string Display name of the template to be shown in the templates list. |
reference |
Type:
string The unique identifier of the player template. Max length for the reference is 150 characters. |
regions |
Type:
object Specifies the regions configuration to pass to Assess API. See full documentation on Assess API's regions options for more information. |
HTML Element Selector
The second parameter passed to window.LearnosityAuthor.init() is a string
, containing a full CSS selector to an element on the HTML page. Each example below could be a valid value:
#learnosity_author // CSS selector based on id of an element
.learnosity_author // CSS selector based on a class of an element
This value tells Author API where to render itself on the page.
Note
If the HTML element selector is not provided, Author API will attempt to look for the element with a id "learnosity-author"
.
Note See the quick start guide for more information on how to build an example HTML page.
Callbacks
The callbacks object contains optional callback functions that allow detection of the 'ready' status of a Author API instance and any errors encountered.
These events can be handled by defining a readyListener
function and an errorListener
function respectively.
Parameters | |
---|---|
error |
Type:
error Object containing error details. |
See available events for more information.
Parameters | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mediaRequested |
Type:
string Determine the type of media
Possible values:
|
||||||||||||
returnType |
Type:
string Lets the function know whether to supply HTML, a URL, or an object that contains image's URL, width and height.
Possible values:
|
||||||||||||
callback |
Type:
callback() Function to be executed once the returnType is ascertained. |
||||||||||||
attributes |
Type:
attributes JSON object containing properties of the asset.
|
function(mediaRequested, returnType, callback, attributes) {
// Function that opens an asset browser or uploader and then calls
// callback(URL|HTML|UrlHeightWidth)
},
Properties: | |
---|---|
name |
Type:
string A unique identifier for the button. |
icon |
Type:
string A link to the button icon (Recommended dimensions: 25px by 25px).
|
label |
Type:
string The buttons label. |
func |
The callback function which is executed when the custom button is clicked. |
attributes |
Type:
array A string array containing the path selectors of the rich text editors with which the custom buttons are to be
associated with. If this is undefined (or empty), the buttons will be associated with all rich text editor instances. For array type fields like options, you can either define a selector for a specific entry, e.g. options[0] ,
or you can specify a selector targeting the whole array, e.g. options[*] . For more on rich text editor
selectors see the editor layout components section.
|
"customButtons": [{
"name": "name",
"label": "label",
"icon": "icon",
"func": function( attribute, callback) {
// Function that opens a form which enables embedding of custom
// content into the editor and then calls callback(HTML)
},
"attributes": []
}]
} // EventOptions object.
Properties: | |
---|---|
code |
Type:
number Error code. |
message |
Type:
string Message containing information about the error. |
status |
Type:
boolean |
timestamp |
Type:
number Returns time (in milliseconds) when the error occurred. |
Parameters | |||||
---|---|---|---|---|---|
attribute |
Type:
string |
||||
callback |
Type:
function(customContent) Call this function to add the custom content to the text editor.
|