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

Input

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

Result

[{
   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.
snapshotId A snapshot contains a collection of published exercises, defined in AlgebraKiT's CMS. Either snapshot or version is required if exerciseId is given.
version The published version number of the exercise (number) or 'latest' to indicate the current version in the CMS. Either snapshot or version is 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 (see attributes ).

Returns

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
Contact info@algebrakit.nl
Demo +31 85 1308316
Privacy Policy Eindhoven, the Netherlands
Copyright AlgebraKiT 2018