Assessment/Activity

Everything relating to the activity currently loaded by Items API.

Methods

activity() → {object}

The activity configuration object, including anything overridden at runtime if using activity templates.

Since
0.1.0
Returns: 
object

activityId() → {string}

The activity id used for this activity instance used to group related sessions.

Since
0.1.0
Returns: 
string

activitySubTitle() → {string}

The visible subtitle from the configuration object.

Since
0.1.0
Returns: 
string

activityTags() → {array}

All tags that have been set against items in the activity. Requires retrieve_tags to be set to true in the Items API configuration.

Since
2.9.0
Returns: 
array

activityTemplateId() → {string}

The activity_template_id if templates are used. Returns '' if templates aren't being used.

Since
0.1.0
Returns: 
string

activityTitle() → {string}

The visible title from the configuration object.

Since
0.1.0
Returns: 
string

adaptiveType() → {string}

The adaptive type as defined in the configuration. Returns '' if the activity isn't adaptive.

Since
0.1.0
Returns: 
string

annotationsConfig() → {object}

The annotations configuration object.

Since
0.1.0
Returns: 
object

autoSaveConfig() → {boolean|object}

The auto-save configuration object. Returns true or an object based on what was in the configuration.

Since
0.1.0
Returns: 
boolean | object

elapsedTime() → {number}

The current elapsed time for the session. Returns whether the timer is visible or not.

Since
2.6.0
Returns: 
number

hasActivityTemplate() → {boolean}

Whether this activity was loaded from an activity template.

Since
0.1.0
Returns: 
boolean

hasAnnotations() → {boolean}

Whether annotations have been configured with this activity.

Since
0.1.0
Returns: 
boolean

hasAnswerMasking() → {boolean}

Whether this activity contains answer masking enabled.

Since
2.15.0
Returns: 
boolean

hasAutoSave() → {boolean}

Whether auto-save is configured with this activity.

Since
0.1.0
Returns: 
boolean

hasEvents() → {boolean}

Whether events have been configured with this activity.

Since
0.1.0
Returns: 
boolean

hasItemPool() → {boolean}

Whether an item pool has been configured with this activity.

Since
0.1.0
Returns: 
boolean

hasLineReader() → {boolean}

Whether this activity contains the line reader at the player level.

Since
2.15.0
Returns: 
boolean

hasResourceItems() → {boolean}

Whether this activity contains resource item(s).

Since
0.1.0
Returns: 
boolean

hasSections() → {boolean}

Whether this activity contains sections.

Since
0.1.0
Returns: 
boolean

hasShuffledItems() → {boolean}

Whether items have been shuffled within this activity.

Since
0.1.0
Returns: 
boolean

hasTryAgain() → {boolean}

Whether the activity has try again enabled.

Since
1.4.0
Returns: 
boolean

isAdaptive() → {boolean}

Whether this activity is adaptive.

Since
0.1.0
Returns: 
boolean

isResuming() → {boolean}

Whether the user is resuming the session.

Since
0.1.0
Returns: 
boolean

isVerticalLayout() → {boolean}

Whether the activity is rendered using the vertical layout. In which case, things like items.item() are not available.

Since
3.0.0
Returns: 
boolean

itemBank() → {string}

The global organisation_id used for this activity instance.

Since
0.1.0
Returns: 
string

itemPool() → {string}

The item_pool_id used for this activity instance.

Since
0.1.0
Returns: 
string

maxTime() → {number}

The maximum time allowed for this session. If 0, it means unlimited time.

Since
2.6.0
Returns: 
number

region() → {string}

Which UI region the session was set up with. Values include:

  • main
  • horizontal
  • horizontal-fixed

undefined will mean that no regions key was found in the Items API configuration, meaning the player defaults to the legacy UI region (not recommended).

Since
1.1.0
Returns: 
string

resourceItems() → {array}

The resource item references used for this activity instance.

Since
0.1.0
Returns: 
array

sessionId() → {string}

The session_id used for this activity instance.

Since
0.1.0
Returns: 
string

state() → {string}

The current state of this activity instance. Possible values:

  • initial
  • resume
  • review
  • preview
Since
0.1.0
Returns: 
string

timeRemaining() → {number|null}

The time remaining in the session. If max_time hasn't been set, the session is unlimited, so this returns null.

Since
2.6.0
Returns: 
number | null

totalItems() → {number}

The total number of items in the activity, including items within sections if relevant.

Since
0.1.0
Returns: 
number

userId() → {string}

The user_id as defined in the configuration.

Since
0.1.0
Returns: 
string