Assessment/Player

Everything relating to the assessment player.

Methods

answerMasking(action)

Shows or hides the player answer masking tool. Answer masking has to be enabled in Items API configuration for this to work.

Parameters:
NameTypeDescription
actionboolean

Whether to show (true) or hide (false).

Since
2.15.0

dialog(config)

Renders an Items API custom dialog.

Parameters:
NameTypeDescription
configobject

Dialog configuration

Since
0.1.0
Example
LT.dialog({
    "header": "My heading",
    "body":  "Custom body with <strong>html</strong> support",
    "buttons": [
        {
            "button_id": "my_primary_button",
            "label": "My Primary Button",
            "is_primary": true
        },
        {
            "button_id": "my_standard_button",
            "label": "My Standard Button",
            "is_primary": false
        }
    ]
});

hideDialog()

Hides a custom dialog.

Since
1.1.0

isResponsiveMode() → {boolean}

Checks whether the player is in responsive mode. This will be either the small or medium breakpoints. See more https://help.learnosity.com/hc/en-us/articles/360000758337-Customizing-the-Assessment-Player-experience-with-User-Interface-Regions#responsive-behavior

Since
1.2.0
Returns: 
boolean

isReviewScreen() → {boolean}

Check that the review screen has been loaded.

Since
0.1.0
Returns: 
boolean

lineReader(actionopt)

Shows or hides the player line reader. The line reader has to be enabled in Items API configuration for this to work.

Parameters:
NameTypeAttributesDescription
actionstring<optional>

Whether to toggle (default), show or hide the line reader.

Since
2.15.0

navigate(target)

Generic function to call API navigation methods. Supports:

  • previous
  • next
  • review
  • submit
  • Number (0-based) representing the item index

Internally this calls next(), previous(), review(), or goto() and submit().

Parameters:
NameTypeDescription
targetstring
Since
0.1.0

next()

Navigates to the next item. No-op if on the last item.

Since
0.1.0

previous()

Navigates to the previous item. No-op if on item #1.

Since
0.1.0

review()

Toggles the review screen.

Since
0.1.0

submit()

Submits the session.

Since
0.1.0