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.
Name | Type | Attributes | Description |
---|---|---|---|
response_id | string | <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).
Name | Type | Attributes | Description |
---|---|---|---|
response_id | string | <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.
Name | Type | Attributes | Description |
---|---|---|---|
response_id | string | <optional> |
- Since
- 0.1.0
- Returns:
- object
A question JSON 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.
Name | Type | Attributes | Description |
---|---|---|---|
response_id | string | <optional> |
- Since
- 0.4.0
- Returns:
- object
A question app instance.
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.
Name | Type | Attributes | Description |
---|---|---|---|
response_id | string | <optional> |
- Since
- 0.1.0
- Returns:
- object
The response object for the question, null if no attempts yet.
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.
Name | Type | Attributes | Description |
---|---|---|---|
response_id | string | <optional> |
- Since
- 0.1.0
- Returns:
- object
The score object for the question.
questions() → {array}
Returns all question JSON on the current item.
Returns [] if no questions were found.
- Since
- 0.1.0
- Returns:
- array