Initialization

This article details the properties that are passed as parameters to the window.LearnosityItems.init() method to initialize Items API.

This method is the starting point to initializing and rendering Items API, and as you can see in the example below, takes two key parameters.

Only the Initialization object is mandatory. Further detail on getting started and initializing Items API can also be found in the Quick Start guide.

var initializationObject = {
    "security": {
        "consumer_key": "INSERT_CONSUMER_KEY_HERE",
        "domain": "my.domain.com",
        "timestamp": "20120202-1234",
        "signature": "SHA256-HASH - See Security"
    },
    "request": {
        "activity_id": "math.c2.u7",
        "name": "Math Chapter 2 – Unit 7",
        "rendering_type": "assess",
        "state": "initial",
        "type": "submit_practice",
        "session_id": "0adc8ac1-d71f-494e-860b-378c2d75a926",
        "user_id": "43466577",
        "items": [
            "Demo3",
            "Demo4",
            "accessibility_demo_6",
            "Demo6",
            "Demo7",
            "Demo8",
            "Demo9",
            "Demo10",
            "audioplayer-demo-1"
        ],
        "config": {
            "title": "Math Chapter 2 – Unit 7",
            "subtitle": "Walter White",
            "regions": "main",
            "navigation": {
                "show_intro": true,
                "show_outro": true,
                "skip_submit_confirmation": false,
                "warning_on_change": false,
                "auto_save": {
                    "saveIntervalDuration": 500
                },
            "annotations": "true"
            },
            "time": {
                "max_time": 1500,
                "limit_type": "soft",
                "warning_time": 120
            },
            "configuration": {
                "shuffle_items": false,
                "idle_timeout": {
                    "interval": 300,
                    "countdown_time": 60
                }
            }
        }
    }
};

var callbacks = {
    errorListener: function (e) {
        // Adds a listener to all error codes.
        console.log("Error Code ", e.code);
        console.log("Error Message ", e.msg);
        console.log("Error Detail ", e.detail);
    },

    readyListener: function () {
        console.log("Learnosity Items API is ready");
    }
};

var itemsApp = window.LearnosityItems.init(initializationObject, callbacks);
        

Initialization Object

The Initialization object is a JSON object which is passed as the first parameter into the window.LearnosityItems.init() method. It includes all the information needed to initialize the API.

It contains the following two top-level properties:

The Security object is a property generated by the Learnosity serverside SDKs to ensure that any of the APIs are only initialized from a secured, allowed source, using your consumer key and secret.

This is handled by our SDKs in PHP, Java, Python, Ruby or C#. For other languages, please see our Security & Authentication page on how to sign your requests.

The Request object contains all of the configuration properties for user & session identification, UI look and feel, as well as which Items or activities to load.

Only a few properties are mandatory, the rest provide a high level of customization to enable you to tailor the Assessment experience to suit your needs.

Properties

= mandatory property

string

The ID of the Activity that will be used in Learnosity's Reports API and Data API to group all unique user sessions together. Should not exceed 36 characters. Recommended to be a UUID.

Use a value that represents different end users attempting the same "test" blueprint, as you can then request reports for all sessions that share the same activity_id.

Important Required only if submitting responses to Learnosity.

string
Reference to an activity template stored in Learnosity's Item Bank. Also for Item Bank content to control most parts of Assessment configuration.

See Activity definition for more information.

object

Configuration for an adaptive assessment. Learnosity offers several forms including; Item Adaptive Testing, Item Branching and Testlet Adaptive.

Important Only supported with rendering_type: "assess" and supercedes items

See Adaptive and Dynamic Assessments for more information.

object

The properties inside this object are used to configure options relating to the user experience and behaviour of Items API.

Properties:
administration
Type: object

Enables a password protected panel of options adminstrators can use to change accessibility settings like color schemes and fontsize. The activity can also be exited from here.

Important Supported with rendering_type: "assess" only.

annotations
Type: boolean

When set to true, the Annotations API is enabled with all modules using default initialization options.

Important Supported with rendering_type: "assess" only.

annotations_api_init_options
Type: object

Provide custom initialization options to the Annotations API. This can be used to enable or disable specific modules, or customize their behaviour. When present, this will override the default initialization options specified by annotations: true.

Important Supported with rendering_type: "assess" only.

configuration
Type: object

Enables various customizations such as redirect URLs and reading time settings.

Important Supported with rendering_type: "assess" only.

events
Type: boolean

Loads the Events API internally to enable publishing user events from the assessment player and accepting proctor events via the Reports API.

Important Supported with rendering_type: "assess" only.

Note Events API must be enabled on your consumer for this to work.

Default: false
ignore_question_attributes
Type: Array[string]

Strips attributes from questions on the server before returning them to the browser for rendering.

Note Scoring in the browser is unavailable if "validation" is stripped, as is Check Answer functionality.

labelBundle

Object of labels and values can be passed to override default English labeling

Note The previousButtonLabel setting only interact with the button hover state.

Important Supported with rendering_type: "assess" only.

navigation
Type: object

Customize navigational attributes are available to the user interacting with the player.

Important Supported with rendering_type: "assess" only.

questions_api_init_options
Type: object
Used to define certain behavior which falls under the functionality provided under the hood by the Questions API, specifically concerning question rendering, and scoring behavior.
regions
Type: object

Regions allows you to create a personalized, fluid and extensible assessment UI. The assessment player layout is split into multiple regions which you can customize components of your choice.

Available regions:

  • "top-left"
  • "top-right"
  • "right"
  • "items"
  • "bottom-right"

Important Supported with rendering_type: "assess" only.

See Assessment player regions options for more information.

subtitle
Type: string

Sets the subtitle of the activity.

Important Supported with rendering_type: "assess" only.

Default: ""
time
Type: object
Used to define time parameters including countdown and expiry settings.

Important Supported with rendering_type: "assess" only.

title
Type: string

Sets the title of the activity.

Important Supported with rendering_type: "assess" only.

Default: ""
object

Enables a password protected panel of options adminstrators can use to change accessibility settings like color schemes and fontsize. The activity can also be exited from here.

Important Supported with rendering_type: "assess" only.

Properties:
options
Type: object
Available options for the administration panel.
pwd
Type: string

Makes the administration panel password-protected. The user must provide the correct password to gain access.

Important The supplied value must be a SHA256 hash of the intended password.

object
Available options for the administration panel.
Properties:
show_exit
Type: boolean
Enables the Discard & exit button.
Default: true
show_extend
Type: boolean
Enables the option to add extra time allowed to complete the session.
Default: true
show_save
Type: boolean
Enables the Save & exit button.
Default: true
show_submit
Type: boolean
Enables the Submit & exit button.
Default: true
object

Provide custom initialization options to the Annotations API. This can be used to enable or disable specific modules, or customize their behaviour. When present, this will override the default initialization options specified by annotations: true.

Important Supported with rendering_type: "assess" only.

Properties:
modules
Type: object

Define which modules are enabled and provide module initialization options.

Note Each module can be configured individually. See the Annotations API initialization options documentation for more information.

object

Enables various customizations such as redirect URLs and reading time settings.

Important Supported with rendering_type: "assess" only.

Properties:
auto_retry_failed_images
Type: boolean

If enabled, Learnosity's assessment player will attempt to try to reload any failed images for the given session using a Full Jitter exponential backoff algorithm.

Default: false
contrast

Define the active color scheme.

Note See the assessibility panel knowledge base article for more information on how to create and register a pallete.

disable_item_workflow
Type: boolean

Disable to items workflow from being executed. This feature is useful for editing items without needing to wait out the full workflow.

Note Visit the items workflow knowledge base article for more information on this feature.

Default: false
events
Type: boolean
Whether to enable Events API for publishing/subscribing realtime events for the session.

Note Events API must be enabled on your consumer for this to work.

Default: false
focus_on_player
Type: boolean

Set the focus to the Start button when there is an intro page, or to the first item when there is no intro page.

To prevent the Assessment Player to control the focus of the page, set this option to false.

Default: true
fontsize
Type: string
The font size used to render text content inside Assessment Player.
Possible values:
  • "small"
  • "normal"
  • "large"
  • "xlarge"
Default: "normal"
idle_timeout

When enabled, a dialog box will be shown afer a number of seconds of inactivity. Once shown, the user has limited time to close the the dialog to continue with the session.

Failing to close the dialog in time, the current progress will be saved and the session will be discarded.

Note The default inactivity interval is 300 seconds and the default dialog count down time is 60 seconds.

Default: false
lazyload
Type: boolean
Enables lazy loading of items from the Item Bank to improve loading time during API initialization.
Default: false
onsave_redirect_url
Default: "/" (redirects to the home page)
Example: "https://docs.learnosity.com"
onsubmit_redirect_url
Default: "/" (redirects to the home page)
Example: "https://docs.learnosity.com"
questionsApiVersion
Type: string

Load the activity using the specified version of Questions API. The Questions API is used under the hood by the Items API for the purposes of rendering questions and capturing student responses.

If not set, this uses the specific paired minor version as defined in Items API release logs.

Default: paired minor release of Questions API

See Questions API release logs for more information.

reading_mode
Type: object

Allocate a reading time period where the users can browse and read questions. During this time period, attempts at answering questions, pausing or submitting the test will be disabled.

Important The idle_timeout feature is disabled during reading time and this feature is not available in the "review" state.

shuffle_items

Enables shuffling of items based on a given seed.

Important The string value will provide same ordering of items for all sessions, as oppose to true which gives a different order per session.

Note Visit the shuffling items demo for an interacitive example of this feature.

Default: false
submit_criteria
Type: object

Define the criteria the user needs to meet in order to successfully submit their session.

Note By default, the assessment player imposes no criteria to submit the assessment.

submit_failed_options
Type: object

Set the options for the user to manually retrieve and send their session responses in the event of a network failure or server issues preventing submissions.

Note See the failed submit options knowledge base article for an in-depth coverage.

"configuration": {
    "lazyload": false,
    "focus_on_player": false,
    "onsubmit_redirect_url": "https://www.learnosity.com",
    "onsave_redirect_url": false,
    "ondiscard_redirect_url": "https://docs.learnosity.com",
    "reading_mode": {
        "reading_time": 300,
        "warning_time": 60,
        "goto_first_item_on_reading_time_completion": true
    },
    "contrast": "black-on-white",
    "contrast": {
        "active": "Example 1",
        "custom_palettes": [
            {
                "name": "Example 1",
                "colors": {
                    "content-background": "#ffffff",
                    "content-color": "#000000",
                    "content-color-hover": "#cccccc"
                }
            },
            {
                "name": "Example 2",
                "colors": {
                    "content-background": "#ffffff",
                    "content-color": "#000000",
                    "content-color-hover": "#cccccc"
                }
            }
        ]
    },
    "fontsize": "normal",
    "idle_timeout": false,
    "events": false,
    "shuffle_items": false,
    "disable_item_workflow": false,
    "submit_criteria": {
        "type": "attempted",
        "threshold": 0.1
    },
    "submit_failed_options": {
        "mailto": false,
        "download": true
    },
    "auto_retry_failed_images": false
}
object | string

Define the active color scheme.

Note See the assessibility panel knowledge base article for more information on how to create and register a pallete.

Types
object
Properties:
active
Type: string

Contains the name of a palette to use as the active palette. This name will be used to find the palette settings inside the custom_palettes.

custom_palettes
Type: Array[string | AccessibilityPalette]
Define all the available custom palettes.
string

A valid URL to a custom CSS file containing the assessibility palettes. This assessibility scheme will be loaded by default.

boolean | object

When enabled, a dialog box will be shown afer a number of seconds of inactivity. Once shown, the user has limited time to close the the dialog to continue with the session.

Failing to close the dialog in time, the current progress will be saved and the session will be discarded.

Note The default inactivity interval is 300 seconds and the default dialog count down time is 60 seconds.

Types
boolean

Set to true to enable the idle timeout feature with the default timing values.

object
Properties:
countdown_time
Type: number
The dialog count down time in seconds before the session will be saved and discarded.
interval
Type: number
The inactivity time period in seconds.
Default: false
boolean | string
Types
boolean
Set to false to prevent any redirect.
string

Automatically redirect to the supplied URL when the user choose to exit after finished saving an activity.

Note It is assumed that the supplied URL is valid. There will be no validation on this field.

Default: "/" (redirects to the home page)
Example: "https://docs.learnosity.com"
boolean | string
Types
boolean
Set to false to prevent any redirect.
string

Automatically redirect to the supplied URL when the user closes the activity after submitting.

Note It is assumed that the supplied URL is valid. There will be no validation on this field.

Default: "/" (redirects to the home page)
Example: "https://docs.learnosity.com"
object

Allocate a reading time period where the users can browse and read questions. During this time period, attempts at answering questions, pausing or submitting the test will be disabled.

Important The idle_timeout feature is disabled during reading time and this feature is not available in the "review" state.

Properties:
goto_first_item_on_reading_time_completion
Type: boolean
Automatically navigate to the first question in the activity once the reading time is over.
Default: false
reading_time
Type: number
Allocate a number of seconds as the reading time period.
Default: 0
warning_time
Type: number
Display a visual warning when n number of seconds left for the reading time.
Default: 0
boolean | string

Enables shuffling of items based on a given seed.

Important The string value will provide same ordering of items for all sessions, as oppose to true which gives a different order per session.

Note Visit the shuffling items demo for an interacitive example of this feature.

Types
boolean
Randomize items using the session_id as the seed.
string
Randomize items using the supplied value as the seed.
Default: false
object

Define the criteria the user needs to meet in order to successfully submit their session.

Note By default, the assessment player imposes no criteria to submit the assessment.

Properties:
threshold
Type: number
The percentage of questions meeting the type criteria. Must be a integer, between 0 and 100 inclusive.
Default: 0
Example: 50
type
Type: string
The type of action the user performed on each question.
Possible values:
  • "attempted"
  • "valid"
Default: "attempted"
object

Set the options for the user to manually retrieve and send their session responses in the event of a network failure or server issues preventing submissions.

Note See the failed submit options knowledge base article for an in-depth coverage.

Properties:
download
Type: boolean
Enables the option to download session responses to file.
Default: true
mailto

When enabled, the default mailto URI is { "to": "", "cc": "", "bcc": "", "subject": "Raw assessment responses" }

Important Not available in Microsoft-based browsers due to mailto URI length limit in IE

Default: false

When enabled, the default mailto URI is { "to": "", "cc": "", "bcc": "", "subject": "Raw assessment responses" }

Important Not available in Microsoft-based browsers due to mailto URI length limit in IE

Types
boolean
Enabling sending out emails with the default mailto options.
object
Properties:
to
Type: string
Main recipent email address.
cc
Type: string
CC email address.
bcc
Type: string
BCC email address.
subject
Type: string
Email subject.
Default: false
object

Customize navigational attributes are available to the user interacting with the player.

Important Supported with rendering_type: "assess" only.

Properties:
auto_save

Enable automatic saving of responses during assessment sessions.

Note By default, this feature will check every 300 seconds for changes to the sessions responses, and silently save the responses.

Default: true
exit_securebrowser
Type: boolean
Enable to exit the secure browser once the session is finished.
Default: true
intro_item
Type: string

The intro item reference, which the Items API will render at the beginning of the session.

outro_item
Type: string

The outro item reference, which the Item API renders after the session has been completed.

scroll_to_test

When enabled, this allows Items API to scroll the page to the top of its assessment container when the session starts.

Note This feature is useful for long pages where the user may scroll past the assessment container, moving it out of focus.

Default: true
scroll_to_top

When enabled, this allows Items API to scroll to the top of the container when the user naviagtes to the next or previous item.

Note This feature has the same behavior as scroll_to_test, but triggers every time the user navigates between items.

Default: true
show_acknowledgements
Type: boolean

Enable to show any acknowledgement of assets used in the test for copyright purposes.

Note This information will be shown inside the outro item.

Default: false
show_intro
Type: boolean
Enable to show an introduction page. If intro_item is not set, the default intro Item will be used instead.
Default: true
show_outro
Type: boolean
Enable to show an outro page. If outro_item is not set, the default outro Item will be used instead.
Default: true
skip_submit_confirmation
Type: boolean
Enable to prevent any user interaction after clicking Finish/Submit test. The test will be submitted and the page will automatically be redirected (if enabled).
Default: false
"navigation": {
    "auto_save": {
        "changed_responses_only": false,
        "save_interval_duration": 500,
        "ui": true,
    },
    "skip_submit_confirmation": false,
    "show_intro": true,
    "intro_item": "Intro Item Reference 123",
    "show_outro": true,
    "outro_item": "Outro Item Reference 456",
    "show_acknowledgements": true,
    "scroll_to_top": true,
    "scroll_to_test": true,
    "exit_securebrowser": true
}
boolean | object

Enable automatic saving of responses during assessment sessions.

Note By default, this feature will check every 300 seconds for changes to the sessions responses, and silently save the responses.

Types
boolean
Enables auto saving with the default behavior.
object
Properties:
changed_responses_only
Type: boolean

Only auto-save when there are changes to reponses.

Note Set to false to have the auto save feature triggers periodically regardless of changes to responses.

Default: true
save_interval_duration
Type: number
The number of seconds between each auto-save check.
Default: 300
ui
Type: boolean
Enable a UI indicator.
Default: false
Default: true
boolean | object

When enabled, this allows Items API to scroll the page to the top of its assessment container when the session starts.

Note This feature is useful for long pages where the user may scroll past the assessment container, moving it out of focus.

Types
boolean
Enable scrolling to the top of the assessment container without any additional offset.
object
Properties:
offset_top
Type: string

Enable scrolling above top of the assessment container based on the offset. Value in px.

Note This setting is useful when having a custom header above the assessment container.

Example: "10px"
Default: true
boolean | object

When enabled, this allows Items API to scroll to the top of the container when the user naviagtes to the next or previous item.

Note This feature has the same behavior as scroll_to_test, but triggers every time the user navigates between items.

Types
boolean
Enable srolling to the top of the assessment container without any additional offset.
object
Properties:
offset_top
Type: string

Enable scrolling above top of the assessment container based on the offset. Value in px.

Note This setting is useful when having a custom header above the assessment container.

Example: "10px"
Default: true
object
Used to define certain behavior which falls under the functionality provided under the hood by the Questions API, specifically concerning question rendering, and scoring behavior.
Properties:
allow_negative_scores
Type: boolean

When set to true, this feature will allow questions to have negative scores, which will penalize the user by negating from the total score if the answer is incorrect.

When set (to either true or false), this flag takes precedence over the same setting in individual questions.

When omitted, the default behavior is to normalize any negative scores to zero. Individual questions can still override that behavior by specifying their own value for allow_negative_scores.

captureOnResumeError
Type: boolean

By default, when initializing an activity in the "resume" state, Items API will trigger an error for any question's response_id not found within the Learnosity database.

If enabled, Items API will suppress the above error, effectively applying the same behavior as the "initial" state for those questions.

This only apply to activities initialized with "submit_practice" type.

Important As of Items API v1.76, this functionality is deprecated due to changes in state management.

Default: false
fontsize
Type: string

The text font size used for rendering.

Important Supported with rendering_type: "inline" only.

Possible values:
  • "small"
  • "normal"
  • "large"
  • "xlarge"
  • "xxlarge"
Default: "normal"
math_renderer
Type: string

This option allows you to overwrite the math_renderer option inside all questions.

Possible values:
  • "mathjax"
  • "mathquill"
Default: "mathjax"
renderSaveButton
Type: boolean

If enabled, Items API will render a save button, enabling users to save their current progress to the Learnosity database.

Note For more information, see the advanced save and submit handling knowledge base article.

Important Supported with rendering_type: "inline" only.

Default: false
renderSubmitButton
Type: boolean

If enabled, Items API will render a submit button.

Note For more information, see the advanced save and submit handling knowledge base article.

Important Supported with rendering_type: "inline" only.

Default: false
showCorrectAnswers
Type: boolean

This flag has different behaviors based on the value provided for state.

In "initial" or "resume" state:

  • When set to true, the correct answer will be shown when the user choose to check answers.
  • When set to false, the correct answer will not be shown.
  • When omitted, the correct answer will not be shown.

In "review" state:

  • When set to true, the correct answers will be shown together with the user answers.
  • When set to false, the correct answers will be hidden.
  • When omitted, the correct answers will be shown together with the user answers.

Note This flag has no behavioral changes in the "preview" state.

showInstructorStimulus
Type: boolean

If enabled, the content stored inside the instructor_stimulus will be shown above the question's stimulus.

Note This can be used to show additional information to the administrators but not the users taking the assessment.

Default: false
validateOnSubmit
Type: boolean

If enabled, Items API will determine whether instant feedback should be provided when the users submit their assessment.

Not all questions support this feature. Incompatible questions will be ignored.

Note When enabled, all supported questions will be validated regardless of the setting of instant_feedback inside each question.

Important Each question may define its own maximum number of validation attempts through feedback_attempts. Once reached, the question will not be validated again.

Important Supported with rendering_type: "inline" only.

Default: false
object
Used to define time parameters including countdown and expiry settings.

Important Supported with rendering_type: "assess" only.

Properties:
countdown
Type: number
Count down time in seconds shown in administrator remote control modal - integer.
Default: 10
countdown_option
Type: boolean
Enable the count down timer.
Default: false
limit_type
Type: string
Specify the action when the time limit expires. A hard limit forces a test submit, a soft limit has no action.
Possible values:
  • "soft"
  • "hard"
Default: "soft"
max_time
Type: number
The length of test session, in seconds - integer.
Default: 1500
warning_time
Type: number
If set, the assessment player will show a visual dialog when the session has warning_time seconds left - integer.
"time": {
    "max_time": 0,
    "limit_type": "soft",
    "warning_time": 60,
    "countdown_option": true,
    "countdown": 10
}
boolean

Loads the Events API within the Assessment enabling publishing of custom events for advanced use-cases.

Note Events API must be enabled on your consumer for this to work.

See Events API item.publishEvent() for more information.

Default: false
array[string|object]

Sets the content to be shown in the session. Can be an array of unique string Item references, or an array of objects for advanced usage.

Important This is a mandatory property unless adaptive is configured, or using an activity_template_id with items in it.

Properties:
id
Type: string
A host-page supplied unique identifier (which can be the same as the item reference).

See Multiple Item source requirements for more information.

item_pool_id
Type: string
Sets the Item Pool to retrieve content from.

See Data API Pools for more information.

organisation_id
Type: string
Sets the Item Bank to retrieve content from.

See Multiple Item sources for more information.

reference
Type: string
The item reference to retrieve
scoring_type
Type: string
The scoring type specified in the Item Bank can be overriden for each item. If desired, it can also be overridden for the entire activity. If both an item-level and an activity-level scoring types are specified, the item-level configuration takes precedence.
string

Name of the activity that will be displayed in Learnosity's Reports API and Data API.

Important Required only if submitting responses to Learnosity.

string
The rendering type dictates whether the activity will be rendered using the Learnosity's assessment player, or Items embedded in multiple different locations.
Possible values:
  • "assess"
  • "inline"
boolean
Brings the Item tags along with the assessment content. Used for content debugging in test environments or other advanced use-cases.
Default: false
string
Override the scoring type of the items loaded from the Item Bank (unless otherwise overridden per item, which takes precedence).

See Item Scoring tutorial for more information.

array[object]

Sections allow split a single activity into discrete buckets of items, with the ability to have different activity configuration per section.

Important Once students progress to a new section, they cannot navigate back.

Properties:
config
Type: array[object]
You can override initial configuration by passing properties such as regions e.g. allowing assessments to be broken up into sections for delivery, with some sections having specific tools (e.g. calculator) and others not.
items
Type: array[object]
This works exactly like items in a normal activity.

See items definition for more information.

string

This ID is used to uniquely identify the users assessment session.

Important Must be a valid UUID Version 4. e.g: f47ac10b-58cc-4372-a567-0e02b2c3d479

object

Custom metadata to include for the user's assessment session. This metadata is stored when the session is saved or submitted.

string

Sets the state of the activity.

Since version v1.76 of Items API, for submit_practice type, Items API always checks if the session exists to decide if state should be initial or resume and adjusts it accordingly. This means you only need to set it when wanting to initialise with review state.

Possible values:
  • "initial"
  • "resume"
  • "review"
Default: "initial"
array
Subscores are a breakdown of a total score achieved for an activity. They allow you to extract groups of Items, and focus on scoring them separately.

See Activity Subscores for more information.

string
Defines the session context, including whether student responses are to be submitted and stored or remain available locally only.
Possible values:
  • "local_practice" - assessment is rendered, but the responses will not be stored in Learnosity's servers
  • "submit_practice" - assessment is rendered and responses are stored in Learnosity's servers, allowing for grading and review of the session
  • "feedback" - the assessment is aimed at capturing teacher's feedback. More information
Default: "submit_practice"
string
The ID of the user that is attempting the assessment. Should not exceed 50 characters, nor contain any personally identifiable information. Recommended to be a UUID.

The Callbacks object contains optional callback functions that allow detection of the 'ready' status of an Items API instance and any errors encountered.

An example of how to construct this object can be seen above.

The readyListener callback in particular is very important for the correct functioning of Items API. Most of the methods provided by the returned object from window.LearnosityItems.init() will not be fully available until after the readyListener callback has triggered.

Properties

Function to be called on a Learnosity error event. Receives an Error object.

See troubleshooting for more information.

Parameters
error
Type: Error
Function to be called when the API has been successfully initialised.

In the Initialization object and Callback sections above, there are some object definitions which are complex enough to document separately. These are listed below, and linked from the relevant documentation above.

Objects

object
Properties:
colors
name
Type: string
A name that describes the palette.
object
Properties:
button-background
Type: string
Hex or RGB color code.
button-background-highlight
Type: string
Hex or RGB color code.
button-background-highlight-hover
Type: string
Hex or RGB color code.
button-background-hover
Type: string
Hex or RGB color code.
button-color
Type: string
Hex or RGB color code.
button-color-highlight
Type: string
Hex or RGB color code.
content-background
Type: string
Hex or RGB color code.
content-background-correct
Type: string
Hex or RGB color code.
content-background-highlight
Type: string
Hex or RGB color code.
content-background-highlight-hover
Type: string
Hex or RGB color code.
content-background-incorrect
Type: string
Hex or RGB color code.
content-background-selected
Type: string
Hex or RGB color code.
content-border
Type: string
Hex or RGB color code.
content-border-correct
Type: string
Hex or RGB color code.
content-border-focus
Type: string
Hex or RGB color code.
content-border-incorrect
Type: string
Hex or RGB color code.
content-color
Type: string
Hex or RGB color code.
content-color-active
Type: string
Hex or RGB color code.
content-color-hover
Type: string
Hex or RGB color code.
Type: string
Hex or RGB color code.
Type: string
Hex or RGB color code.
Type: string
Hex or RGB color code.
content-color-neutral
Type: string
Hex or RGB color code.
content-color-subheading
Type: string
Hex or RGB color code.
content-color-toolbar
Type: string
Hex or RGB color code.
content-color-widget
Type: string
Hex or RGB color code.
progress-background
Type: string
Hex or RGB color code.
progress-color
Type: string
Hex or RGB color code.
well-background
Type: string
Hex or RGB color code.
well-background-toolbar
Type: string
Hex or RGB color code.
well-background-grayed
Type: string
Hex or RGB color code.
well-background-highlight
Type: string
Hex or RGB color code.
well-background-warning
Type: string
Hex or RGB color code.
well-color
Type: string
Hex or RGB color code.
well-color-grayed
Type: string
Hex or RGB color code.
well-color-highlight
Type: string
Hex or RGB color code.
well-color-toolbar
Type: string
Hex or RGB color code.
well-color-warning
Type: string
Hex or RGB color code.
widget-background
Type: string
Hex or RGB color code.
widget-background-active
Type: string
Hex or RGB color code.
widget-background-hover
Type: string
Hex or RGB color code.
widget-background-toolbar
Type: string
Hex or RGB color code.
object

See troubleshooting for more information.

Properties:
code
Type: number
msg
Type: string
detail
Type: string