checkValidation()
Checks whether the question currently being edited has a correct answer set.
Examples
var result = questionEditorApp.checkValidation({ showErrors: true }); // { has_validation: true }
Arguments
-
options object
-
showErrors booleanWhen
true
and a correct answer is not set, this will highlight the "Set correct answer(s)" section in the UI.Default:
false
-
Return value
- validationStatusObject object
A return object of
checkValidation
that containshas_validation
property which indicates the presence of validationProperties has_validationboolean If
true
, the question currently being edited has a correct answer set. - false
If the operation can not be performed.
i.e., the widget currently being edited is not a question, or the editor is not in the widget edit view.Note An error message will also be logged to the console.