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
- Type
- (object)
activityId() → {string}
The activity id used for this activity instance used to group related sessions.
Since
- 0.1.0
Returns
- Type
- (string)
activitySubTitle() → {string}
The visible subtitle from the configuration object.
Since
- 0.1.0
Returns
- Type
- (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
- Type
- (array)
activityTemplateId() → {string}
The activity_template_id
if templates are used.
Returns '' if templates aren't being used.
Since
- 0.1.0
Returns
- Type
- (string)
activityTitle() → {string}
The visible title from the configuration object.
Since
- 0.1.0
Returns
- Type
- (string)
adaptiveType() → {string}
The adaptive type as defined in the configuration. Returns '' if the activity isn't adaptive.
Since
- 0.1.0
Returns
- Type
- (string)
annotationsConfig() → {object}
The annotations configuration object.
Since
- 0.1.0
Returns
- Type
- (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
- Type
- (boolean | object)
elapsedTime() → {number}
The current elapsed time for the session. Returns whether the timer is visible or not.
Since
- 2.6.0
Returns
- Type
- (number)
hasActivityTemplate() → {boolean}
Whether this activity was loaded from an activity template.
Since
- 0.1.0
Returns
- Type
- (boolean)
hasAnnotations() → {boolean}
Whether annotations have been configured with this activity.
Since
- 0.1.0
Returns
- Type
- (boolean)
hasAnswerMasking() → {boolean}
Whether this activity contains answer masking enabled.
Since
- 2.15.0
Returns
- Type
- (boolean)
hasAutoSave() → {boolean}
Whether auto-save is configured with this activity.
Since
- 0.1.0
Returns
- Type
- (boolean)
hasEvents() → {boolean}
Whether events have been configured with this activity.
Since
- 0.1.0
Returns
- Type
- (boolean)
hasItemPool() → {boolean}
Whether an item pool has been configured with this activity.
Since
- 0.1.0
Returns
- Type
- (boolean)
hasLineReader() → {boolean}
Whether this activity contains the line reader at the player level.
Since
- 2.15.0
Returns
- Type
- (boolean)
hasResourceItems() → {boolean}
Whether this activity contains resource item(s).
Since
- 0.1.0
Returns
- Type
- (boolean)
hasSections() → {boolean}
Whether this activity contains sections.
Since
- 0.1.0
Returns
- Type
- (boolean)
hasShuffledItems() → {boolean}
Whether items have been shuffled within this activity.
Since
- 0.1.0
Returns
- Type
- (boolean)
hasTryAgain() → {boolean}
Whether the activity has try again enabled.
Since
- 1.4.0
Returns
- Type
- (boolean)
isAdaptive() → {boolean}
Whether this activity is adaptive.
Since
- 0.1.0
Returns
- Type
- (boolean)
isResuming() → {boolean}
Whether the user is resuming the session.
Since
- 0.1.0
Returns
- Type
- (boolean)
itemBank() → {string}
The global organisation_id
used for this activity instance.
Since
- 0.1.0
Returns
- Type
- (string)
itemPool() → {string}
The item_pool_id
used for this activity instance.
Since
- 0.1.0
Returns
- Type
- (string)
maxTime() → {number}
The maximum time allowed for this session. If 0
, it
means unlimited time.
Since
- 2.6.0
Returns
- Type
- (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
- Type
- (string)
resourceItems() → {array}
The resource item references used for this activity instance.
Since
- 0.1.0
Returns
- Type
- (array)
sessionId() → {string}
The session_id
used for this activity instance.
Since
- 0.1.0
Returns
- Type
- (string)
state() → {string}
The current state
of this activity instance. Possible
values:
initial
resume
review
preview
Since
- 0.1.0
Returns
- Type
- (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
- Type
- (number | null)
totalItems() → {number}
The total number of items in the activity, including items within sections if relevant.
Since
- 0.1.0
Returns
- Type
- (number)
userId() → {string}
The user_id
as defined in the configuration.
Since
- 0.1.0
Returns
- Type
- (string)