From 353473f1dff2da399e5a932c4e2cc4395ea95c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20S=C3=A4nger?= Date: Fri, 19 Aug 2022 14:45:19 +0300 Subject: [PATCH 1/2] Export gradable property from JSAV-min.js Export the gradable property from the JSAV in the player test bench as well. Now it records correct JAAL 2.0. --- testbench/OpenDSA/JSAV/build/JSAV-min.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testbench/OpenDSA/JSAV/build/JSAV-min.js b/testbench/OpenDSA/JSAV/build/JSAV-min.js index 1b650d3..a428ad3 100644 --- a/testbench/OpenDSA/JSAV/build/JSAV-min.js +++ b/testbench/OpenDSA/JSAV/build/JSAV-min.js @@ -482,7 +482,8 @@ var eventData = { "type": action, "currentStep": that.currentStep(), - "totalSteps": that.totalSteps() + "totalSteps": that.totalSteps(), + "gradable": that._undo[that._undo.length - 1].options.grade ?? false, }; that.logEvent(eventData); } From 0905ffb126b9724cd2b6c8067976b90b2381bc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20S=C3=A4nger?= Date: Fri, 16 Sep 2022 12:52:52 +0300 Subject: [PATCH 2/2] Initial working JAAL 2.0 version of player Correctly set initial state from the submission. Flatten modelAnswerSteps and filter on gradable property. --- player.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/player.js b/player.js index a805a61..f169dd7 100644 --- a/player.js +++ b/player.js @@ -115,7 +115,7 @@ function initializeAnimationView(submission, detailed) { function initializeModelAnswerView(submission) { const modelAnswer = submission.definitions.modelAnswer; if (modelAnswer.length > 0) { - var initialStateHTML = getModelAnswerInitialHTML(modelAnswer); + var initialStateHTML = submission.initialState.modelSvg; } else { $('#model-answer-container').html('

No model answer data

'); return; @@ -164,8 +164,8 @@ function getModelAnswerInitialHTML(modelAnswer) { * @returns a list of the modelAnswer steps with type click. */ function getModelAnswerSteps(modelAnswer) { - // modelAnswer.shift(); - return modelAnswer.filter(step => step.type === 'click'); + modelAnswer = modelAnswer.flat(); + return modelAnswer.filter(step => step.gradable === true); } /**