The JSAV Exercise Recorder is a JavaScript software for creating recordings of Visual Algorithm Simulation exercises. It is based on JSAV and OpenDSA. For extensive background information, see Giacomo Mariani's MSc thesis.
The export data format of the Exercise Recorder is JSON-based Algorithm Animation Language (JAAL). The language is specified in the MSc thesis. Each JAAL recording (file) contains a student's answer to a JSAV-based visual algorithm simulation exercise. The main structure of a JAAL recording is the following.
{
"metadata": {} ,
"definitions": {},
"initialState": {},
"animation": [],
}
The Exercise Recorder is implemented on Node.js. A Node.js tool Browserify compiles all source code and required libraries into file exerciseRecorderBundle.js which can be used with a JSAV-based exercise. The following figure represents the source code modules and the build process.
When an HTML document containing the Exercise Recorder and the JSAV-based
exercise is loaded, the execution from the source code perspective begins at
file exerciseRecorder.js
.
The Exercise Recorder initializes automatically when it is imported into an
HTML document. It starts listening for all JSAV log events. For this reason it
is important that the it is imported in the <head>
element of the HTML
document, before the JSAV exercise is loaded.
Upon initialization the Exercise Recorder will look for the post_url URL parameter, which should contain the URL where the recorded animation data has to be posted. Instead of a URL, the post_url can also contain the string "window", in which case the recorded data will be posted to the window where the Exercise Recorder has been loaded.
Currently the recorded data is sent to the given post_url when the user clicks the grade button.
The tests are written with Jest. To run the tests do the following in this directory:
git checkout master
.npm install
in the root folder of this project (if you have not done yet).npm run test
.
To bundle all the required modules in one file use Browserify:
-
git checkout master
. -
npm install
in the root folder of this project (if you have not done yet). -
npm install -g browserify
if you have not installed it yet. -
browserify exerciseRecorder.js > build/jsav-exercise-recorder-bundle.js
. -
Add the bundle to the exercise HTML file
<head>
element using a<script>
tag like:<script src="<PATH>/<TO>/build/jsav-exercise-recorder-bundle.js"></script>
.