Questions API Methods
validQuestions()
Depending on the mode, it returns:
-
"simple": an array of the validresponse_idsin the current activity -
"detailed": an object withresponse_idsas keys and boolean as value indicating whether the question is valid or not -
"detailedWithPartials": an object withresponse_idsas keys and object as value containing:- correct: boolean indicating whether the question is valid or not
- partial: array detailing whether each individual response is valid or not is returned only if the question can have multiple responses
Note This method is synchronous. It immediately evaluates the validity of the Questions and returns the results.
Note An optional callback can also be provided. When supplied, the results are passed to the callback once validation completes.
Arguments
-
mode string
Default:
"simple"Possible values
"simple""detailed""detailedWithPartials"
-
callback function
Optional. Callback that must be used to get results in cases where asynchronous Question types are present.
The following arguments are available.
-
results object
As per return description above.
-
Return value
None (undefined).