From 4776d4019b90e4c7ffa00ed7909ddbc0b3877487 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Mon, 14 Dec 2015 17:23:01 +0000 Subject: [PATCH] bugfix/attempts-restore: attemptsLeft restore fix --- js/serializers/questions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/serializers/questions.js b/js/serializers/questions.js index 35b95066..ad6d1542 100644 --- a/js/serializers/questions.js +++ b/js/serializers/questions.js @@ -74,7 +74,8 @@ define([ var numericParameters = [ blockLocation, block['_trackingId'], - component['_score'] || 0 + component['_score'] || 0, + component['_attemptsLeft'] || 0 ]; var booleanParameters = [ @@ -137,6 +138,7 @@ define([ var blockLocation = numericParameters[0]; var trackingId = numericParameters[1]; var score = numericParameters[2]; + var attemptsLeft = numericParameters[3] || 0; var hasUserAnswer = booleanParameters[0]; var isUserAnswerArray = booleanParameters[1]; @@ -154,6 +156,7 @@ define([ component.set("_isSubmitted", isSubmitted); component.set("_score", score); component.set("_isCorrect", isCorrect); + component.set("_attemptsLeft", attemptsLeft); if (hasUserAnswer) { var userAnswer = dataItem[2];