Exercise Editor Component

Inserting the Web Component

You insert the Exercise Authoring Component using the akit-exercise-editor tag.

<html>
   <body>
      ...
      <akit-exercise-editor></akit-exercise-editor>
      ...
      <!--Configure proxy -->
      <script>
            AlgebraKIT = {
                config: {
                    secureProxy: {
                        url: '/algebrakit-secure'
                    },
                }
            }
      </script>

      <!--Load frontend API -->
      <script src="https://widgets.algebrakit.com/akit-widgets.min.js"></script>
   </body>
</html>

You can find a working example here.

Getting and setting the Exercise Specification

The exercise editor initializes with an empty exercise. Use javascript to set or get the Exercise Definition object.

Method Description
getExercise getExercise(): Promise<ExerciseDefinition>
Obtain the exercise definition, which you can use to create a new session.
updateExercise updateExercise(ex: ExerciseDefinition): Promise<void>
Initialises the authoring components with the given exercise definition.

Configuring the Exercise Authoring component

Attribute Description
audiences An 'audience' refers to a student profile, which Algebrakit uses to adjust language, mathematical notation, and solution strategies. This attribute specifies which audiences are available for the author. If omitted, Algebrakit will use the highest secondary education level in the United Kingdom (A-level).
Example: audiences='[ {"name": "Nederlands", "id":"vwo-b"}, {"name": "English", "id": "uk_KS5"}]'
enable‑basic‑info Enable fields for general information, such as exercise name, comments, and description. The default value is false.
enable‑metadata Enable metadata fields in the settings tab. The default value is false.
enable‑id‑field Show the button to copy the exercise ID to the clipboard. The default value is true
enable‑multiple-questions Allow creating multiple questions, indexed with a, b, c, etc. The default value is true.
enable‑preview Enable a preview button to run the exercise. The default value is true.
allow‑assets Allow including images in the exercise. Default value is true.
interaction-blacklist An optional list of question type identifiers to exclude from the editor. See below for the current list of question types

These are the question types (interactions) with their identifiers:

Question type Identifier
Multi-step MULTISTEP
Fill in the Blanks FILL_IN_THE_BLANKS
Math Table MATH_TABLE
Geometry & Graphs GEOMETRY
Arithmetic Notebook CALCBOOK
Number line NUMBER_LINE
Written Arithmetic ARITHMETIC
Multiple Choice CHOICE
Open Answer OPEN_ANSWER
Data Analysis STATISTICS
Bar Model Method MODEL_METHOD