createEditor - Methods - Evaluation Options Editor API

Evaluation Options Editor API Methods

createEditor()

Creates an instance of the Evaluation Options Editor.

You would want to use this method so that you can let authors configure how Feedback Aide evaluates responses, for example, the marking style, the learner level, or the feedback language.

Important The editor is not displayed until you call the attach() method on the returned editor.

Examples

// Create an editor that opens in a dialog, and load existing options into it
const editor = await evaluationOptionsEditorApp.createEditor({
    variant: 'modal',
    options_json: {
        grading: {
            marking_style: 'harsh'
        }
    }
});

Arguments

  • options object

    Settings that control how the editor is created.

    The following properties are supported.

    • options_json object

      Specifies the evaluation options to load into the editor.

      You would want to use this argument so that you can load options you saved earlier, for example, the options you stored for a Question.

      The editor shows the default value for every option that is not in the object. If you omit this argument, no options are set. For the format and the default values, see evaluation options.

      Note The editor does not validate these options. To validate them, call the validateOptions() method, or load them with the setOptions() method, which rejects invalid options by default.

    • variant string

      Specifies how the editor is displayed.

      You would want to use this argument so that you can choose between showing the editor directly in your page and opening it in a dialog when the author needs it.

      For more information, see Customizing the Evaluation Options Editor UI using variants.

      Default: "default"

      Possible values

      • "default" - Displays the editor directly in the page.
      • "modal" - Displays an Evaluation options button that opens the editor in a dialog with Cancel and Confirm Options buttons.
    • modules object

      Controls which tabs of options the editor shows.

      You would want to use this argument to hide groups of options that your authors do not need, for example, to hide the Content, Moderation, and Explainability tabs.

      Each property is a boolean. Set a property to false to hide the tab from the Edit view. A tab is shown unless you set its property to false.

      Note The editor reads this value when you create it. You cannot change it afterwards.

      Note Hiding a tab does not remove its values. The options in a hidden tab keep their current values. The View Source view still shows the options of hidden tabs and lets the author edit them, and the number of active agents in the header still includes them.

      // Show only the General tab
      const editor = await evaluationOptionsEditorApp.createEditor({
          modules: {
              content: false,
              moderation: false,
              explainability: false
          }
      });
      

      The following properties are supported.

      • general boolean

        Controls whether the General tab is shown.

        You would want to set this to false so that you can stop authors from changing the learner level, the marking style, the feedback language, or, for short response rubrics, how the feedback is worded.

        Default: true

      • content boolean

        Controls whether the Content tab is shown.

        You would want to set this to false so that you can stop authors from turning on the topic, structure, citation, or language checks.

        Default: true

      • moderation boolean

        Controls whether the Moderation tab is shown.

        You would want to set this to false so that you can stop authors from turning on the inappropriate content, critical safety, or guardrails options.

        Default: true

      • explainability boolean

        Controls whether the Explainability tab is shown.

        You would want to set this to false so that you can stop authors from turning on the justification of score or annotations options.

        Default: true

    • enable_modal_variant_button_icon boolean

      Controls whether the Evaluation options button in the modal variant displays the Feedback Aide icon.

      You would want to set this to false so that you can remove the Feedback Aide branding from the button, for example, when your UI already shows that the options are for Feedback Aide.

      Note This option only affects the modal variant. It has no effect on the default variant.

      Default: true

      Possible values

      • true - The button displays the Feedback Aide icon.
      • false - The button displays its label only.

Return value

Type Promise

Resolves to an evaluationOptionsEditor object, which provides the methods to attach, read, and update the editor.

Related articles

Was this article helpful?

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