From c8f45b3b17d7b6a7fcfdd0fb1ff97de077c122cd Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Fri, 7 Aug 2015 11:42:04 +0100 Subject: [PATCH] fix: use only questions in capture and release --- js/serializers/questions.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/serializers/questions.js b/js/serializers/questions.js index ea773ddf..0f32a2be 100644 --- a/js/serializers/questions.js +++ b/js/serializers/questions.js @@ -5,6 +5,10 @@ define([ //Captures the completion status and user selections of the question components //Returns and parses a base64 style string + var includes = { + "_isQuestionType": true, + "_isResetOnRevisit": false + }; var serializer = { serialize: function () { @@ -35,11 +39,6 @@ define([ var components = Adapt.components.toJSON(); - var includes = { - "_isQuestionType": true, - "_isResetOnRevisit": false - }; - components = _.where(components, includes); var blocks = {}; @@ -145,7 +144,9 @@ define([ var isCorrect = booleanParameters[4]; var block = Adapt.blocks.findWhere({_trackingId: trackingId}); - var component = block.getChildren().models[blockLocation]; + var components = block.getChildren(); + components = components.where(includes); + var component = components[blockLocation]; component.set("_isComplete", true); component.set("_isInteractionComplete", isInteractionComplete);