Authoring Web Component

AlgebraKiT offers a web component that facilitates the creation of AlgebraKiT exercises by authors. This web component can be integrated into your own authoring environment.


Inserting the web component

The authoring component is a html/javascript component that can be added to a web page with just a few lines of code:

      ...  <!-- Whatever your page contains... -->

      <!--Insert the authoring component here -->

      ...  <!-- Whatever your page contains... -->

      <!--Configure proxy -->
            AlgebraKIT = {
                config: {
                    secureProxy: '/algebrakit-secure',

      <!--Load frontend API -->
      <script href=""></script>

Proxy setup

The authoring web component must be able to access the AlgebraKiT web service to test and run exercises. For security reasons, this communication must be handled through a proxy on your backend. This proxy relays incoming traffic to while adding the x-api-key header with your security token. The example code might clearify how to setup such a proxy.

Getting and setting exercises

You can call the following methods on the akit-exercise-editor element. All methods return a Promise

Method Description
getExercise getExercise(): Promise<ExerciseDefinition>
Resolves with the exercise definition that can be used to create a new session.
updateExercise updateExercise(ex: ExerciseDefinition): Promise<void>
Initialises the authoring components with the given exercise definition.

Configuring the 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 ommitted, AlgebraKiT will assume the exercise is intended for a UK student at A-level.
Example: audiences='[ {"name": "Nederlands", "id":"vwo-b"}, {"name": "English", "id": "uk_KS5"}]'
enable‑multiple-questions If set to false, the authoring component cannot be used to generate multipart exercises. A multipart exercise consists of multiple questions, that are indexed with a, b, c, etc. Default value is true.