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|null}

The visible subtitle from the configuration object. Returns null if subtitle isn't being used.

Since
0.1.0
Returns: 
string | null

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|null}

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

Since
0.1.0
Returns: 
string | null

activityTitle() → {string|null}

The visible title from the configuration object. Returns null if title isn't being used.

Since
0.1.0
Returns: 
string | null

adaptiveType() → {string|null}

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

Since
0.1.0
Returns: 
string | null

annotationsConfig() → {object}

The annotations configuration object.

Since
0.1.0
Returns: 
object

autoSaveConfig() → {object}

The auto-save configuration object. Returns the auto-save configuration object, or an empty object if not configured.

Since
0.1.0
Returns: 
object

elapsedTime() → {number}

The current elapsed time for the session in seconds.

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

hasReadingMode() → {boolean}

Whether reading_mode was configured with this activity.

Since
3.0.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() → {number|null}

The global organisation_id used for this activity instance. Returns null if there is no organisation_id set.

Since
0.1.0
Returns: 
number | null

itemPool() → {string|null}

The item_pool_id used for this activity instance. Returns null if there is no item_pool_id set.

Since
0.1.0
Returns: 
string | null

maxTime() → {number}

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

Since
2.6.0
Returns: 
number

region() → {object|null}

The regions configuration object for this session.

null 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: 
object | null

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