setRubric - Methods - Rubric Editor API

Rubric Editor API Methods

setRubric()

Loads the provided rubric and enters the edit mode.

You would want to use this method when you want to load a rubric JSON into the editor, for example, when you want to edit an existing rubric loaded from your database.

Examples

await editor.setRubric({...});

Arguments

  • rubric object

    The rubric JSON object to load into the editor.

  • options object

    Optional settings for loading the rubric.

    The following properties are supported.

    • silent boolean

      Controls whether the change event should be emitted.

      When set to true, the change event will not be emitted.

      You would want to use this argument to load a rubric without triggering the change event.

      Default: false

    • strict boolean

      Controls whether the rubric should be validated against the schema.

      If set to true, the editor will validate the rubric against our predefined rubric schema and reject if invalid.

      If set to false, the editor will only validate the rubric type.

      You would want to use this argument when your rubric contains additional properties that are not part of the schema.

      Default: true

Return value

Type Promise

Resolves when the rubric is loaded, or rejects if invalid.

Was this article helpful?

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