On this page:
Item Navigation
Use the following methods to programmatically navigate a user to items, either progressively, regressively, or by loading a specific Item by ID. Each navigation event automatically triggers save().
loadItem
Loads a specific Item by UUID.
assess.loadItem(itemId, callback); |
Arguments:
Name |
Description |
Return Type |
---|---|---|
itemId |
UUID of item to display. | UUID String |
callback | Function to execute when item is loaded and ready to use. | function |
loadNext
Loads next Item.
assess.loadNext(callback); |
loadPrevious
Loads previous Item.
assess.loadPrevious(callback); |
Listing Items
getItems
Returns an ordered array of items that belong to the test.
assess.getItems(); |
getItemByLocalId
Returns an Item's UUID based on the integer-based ID stored internally by ItemLogic.
assess.getItemByLocalId(); |
To get all items by local ID:
assess.getItemsByLocalId(); |
getItemByVendorId
Returns an Item's UUID based on the Vendor ID as assigned by the item's original publisher. Note: this method may return undefined. The vendor ID must be provided as a string, and because there is always a risk of passing a vendor item ID that is used by multiple vendors, it must be provided in the form: <bank_id>-<vendor_item_id>.
assess.getItemByVendorId(); |
This call will be most helpful by using it in conjunction with another method, for example:
assess.loadItem(assess.getItemByVendorId("32-abc123")); |
To get all items by vendor ID:
assess.getItemsByVendorId(); |
Saving Progress
save
Submits candidate response for the currently loaded/displayed item. It is not necessary to use this command explicitly when navigating between items, as this method is called automatically.
assess.save(callback); |
Scoring
scoreItem
Returns earned vs. max points awarded for the currently loaded item. A JSON object containing these values is passed as an argument to your custom callback method.
assess.scoreItem(fnCallback); |
Example:
assess.score(function(s){ alert('You scored ' + s.earned + ' out of ' + s.max + ' points!'); }); |
isItemAttempted
Returns true if the currently loaded/displayed item has been attempted, or false if not. This boolean value is passed as an argument to your custom callback method.
assess.isItemAttempted(fnCallback); |
validate
Visually marks an item and its features as correct or incorrect. This does not return a score.
assess.validate(); |
User Interaction
pause
Suspends interactivity of an item and all user interface elements.
assess.pause(); |
resume
Resumes interactivity of an item and all user interface elements.
assess.resume(); |
hide
Hides item interface and all ItemLogic generated UI elements from view. This call is helpful if you wish to render some items using our Assess object and some items with your own rendering solution.
assess.hide(); |
show
Shows item interface and all ItemLogic generated UI elements if UI was previous hidden with hide().
assess.show(); |
Finishing a Test
submit
Concludes the assessment session. Call this method ONLY when the assessment is complete, not each time an item response is complete. When this method is called, the assessment will be added to the queue for scoring.
assess.submit(); |