Items API Methods
getCurrentItem()
Obtains the object data for the current active Item.
You would want to use this method so that you can obtain the attempted status of the current Item, for example.
The returned object includes additional information such as: the current time spent on the Item, assessment player metadata, the content of the Item, and more which can be seen in the example.
Important This method only works when the rendering_type
initialization option is set to "assess"
.
Examples
var myCurrentItem = itemsApp.getCurrentItem();
console.log(myCurrentItem);
// Returns
{
"attempt_status": "not_attempted",
"active": true,
"viewed": true,
"time": 62,
"feature_ids": ["..."],
"response_ids": ["..."],
"user_flagged": false,
"reference": "formulas",
"source": {
"reference": "formulas",
"organisation_id": 123456
},
"content": "...",
"metadata": {
"acknowledgements": null,
"scoring_type": "per-question"
},
"questions": [...],
"features": [...],
"simplefeature_ids": [],
"is_last_item": false
}
Arguments
None.
Return value
Type object
Complete JSON data for the current Item. See code example.Related articles
- The
question()
method, the method used to access the interface for a specific Question. - The
feature()
method, the method used to access the interface for a specific Feature.