Assessment/Questions

Everything relating to questions currently loaded by Items API.

Methods

hasCheckAnswer(response_idopt) → {boolean}

Checks whether the "Check Answer" button is enabled for the current question, including if enabled via activity override.

Since
2.11.0
Parameters:
Name Type Attributes Description
response_id string <optional>
Returns
Type
(boolean)

isAutoScorable(response_idopt) → {boolean}

Checks whether the question is auto-scorable. This includes questions that are technically auto-scorable but don't have a validation object set (including when the validation is ignored in Items API configuration).

Since
2.11.0
Parameters:
Name Type Attributes Description
response_id string <optional>
Returns
Type
(boolean)

question(response_idopt) → {object}

Returns the question JSON on the current item.

If the item is multi-part, pass response_id to return the desired question. This argument will also look across all items for the requested response_id.

Returns {} if no question was found on the current item.

Since
0.1.0
Parameters:
Name Type Attributes Description
response_id string <optional>
Returns

A question JSON object.

Type
(object)

questionInstance(response_idopt) → {object}

Returns the question app instance on the current item.

If the item is multi-part, pass response_id to return the desired question.

Since
0.4.0
Parameters:
Name Type Attributes Description
response_id string <optional>
Returns

A question app instance.

Type
(object)

questionResponse(response_idopt) → {object}

A response object for a question on the current item. Defaults to the first question.

Pass response_id if you want a different question response returned in the case of a multi-part item.

Returns {} if no questions found on the item.

Since
0.1.0
Parameters:
Name Type Attributes Description
response_id string <optional>
Returns

The response object for the question, null if no attempts yet.

Type
(object)

questionResponseIds() → {array}

Array of response_id string values for all questions on the current item.

Since
0.1.0
Returns
Type
(array)

questionScore(response_idopt) → {object}

The score object for a question on the current item. Defaults to the first question.

Pass response_id if you want a different question response returned in the case of a multi-part item.

Returns {} if no questions found on the item, or a non-autoscoreable question.

Since
0.1.0
Parameters:
Name Type Attributes Description
response_id string <optional>
Returns

The score object for the question.

Type
(object)

questions() → {array}

Returns all question JSON on the current item.

Returns [] if no questions were found.

Since
0.1.0
Returns
Type
(array)