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.

Parameters:
NameTypeAttributesDescription
response_idstring<optional>
Since
2.11.0
Returns: 
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).

Parameters:
NameTypeAttributesDescription
response_idstring<optional>
Since
2.11.0
Returns: 
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.

Parameters:
NameTypeAttributesDescription
response_idstring<optional>
Since
0.1.0

A question JSON object.

Returns: 
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.

Parameters:
NameTypeAttributesDescription
response_idstring<optional>
Since
0.4.0

A question app instance.

Returns: 
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.

Parameters:
NameTypeAttributesDescription
response_idstring<optional>
Since
0.1.0

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

Returns: 
object

questionResponseIds() → {array}

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

Since
0.1.0
Returns: 
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.

Parameters:
NameTypeAttributesDescription
response_idstring<optional>
Since
0.1.0

The score object for the question.

Returns: 
object

questions() → {array}

Returns all question JSON on the current item.

Returns [] if no questions were found.

Since
0.1.0
Returns: 
array