Question Editor API Methods
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 boolean
When
true
and a correct answer is not set, this will highlight the "Set correct answer(s)" section in the UI.Default:
false
Version added: v2020.2.LTS
-
Return value
Type validationStatusObject
Type 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.