Generate exercise

Generate nonrandom Exercise Definitions from randomised exercises. With these Exercise Definitions you can repeatedly create new sessions using endpoint /session/create. A use case is to let an author define a test from a generated list of exercises. The Exercise Definitions of the chosen exercises can then be stored and used repeatedly.

To save round trips to AlgebraKiT’s web service, you can create multiple instances for multiple randomised exercises in one call.

Endpoint /exercise/generate


   publishId: <string> 
   exercises: [{
      exerciseId?: <string>
      exerciseSpec?: <Exercise Definition>
      level?: <int>
      nr?: <int>
   attributes: [{key: value}]


   success: <boolean>
   msg?: <string>
   instances: [{
     success: <boolean>
     msg?: <string>
     exerciseSpec: <Exercise Definition>
     view: <Exercise View>

Input parameters

exerciseId ID of the exercise in the CMS. Either exerciseId or exerciseSpec is required.
publishId ID of the published version in the CMS. Required if exerciseId is given.
exerciseSpec Exercise Definition of the exercise. Either exerciseId or exerciseSpec is required.
level Optional. Difficulty level for the exercise. Applicable for randomised exercise arrangements, which generally offer multiple levels of difficulty. Default value is 0, which represents the lowest level. The number of levels of difficulty offered by the exercise, can be retrieved from /exercise-info.
nr Optional. Number of sessions to generate for this exercise. Only relevant for randomised exercises. Default value is 1.
attributes Optional. List of key-value pairs to influence the widget.


For each element of input array exercises, an array of length nr with generated exercises.

success Indicates if generating the nonrandom exercise succeeded
msg If generating the nonrandom exercise was not successful, information about the error.
view Information relevant for display in the front end, such as instruction text, assignment expression and required buttons for the formula editor.
exerciseSpec The generated Exercise Definition object.
about algebrakit contact us
Demo +31 624827648
Privacy Policy Eindhoven, the Netherlands
Copyright AlgebraKiT 2018