reset - Methods - Evaluation Options Editor API

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 default variant and options were loaded into it, it fires a change event with an empty options object after the reset event, and the getOptions() method then resolves to an empty object ({}).
  • When the editor is attached with the default variant and the author changed options without any being loaded, the editor keeps showing the author's selections after the reset, even though the getOptions() method resolves to null. To clear the display, call setOptions({}) after the reset.
Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.