Evaluation Options Editor API Methods
reset()
Clears the current evaluation options so that no options are set.
You would want to use this method to return the editor to its initial state, for example, when your author starts configuring a new Question.
After the reset, the getOptions() method resolves to null. The editor shows the default value for every option when the options in it were loaded with the options_json argument or the setOptions() method.
Examples
// Clear the options
await editor.reset();
Arguments
None.
Return value
Type Promise
Resolves when the editor is reset. The editor fires the reset event.
Caveats
- When the editor is attached with the
defaultvariant and options were loaded into it, it fires achangeevent with an empty options object after theresetevent, and thegetOptions()method then resolves to an empty object ({}). - When the editor is attached with the
defaultvariant and the author changed options without any being loaded, the editor keeps showing the author's selections after the reset, even though thegetOptions()method resolves tonull. To clear the display, callsetOptions({})after the reset.