diff --git a/runestone/assess/js/fitb.js b/runestone/assess/js/fitb.js index 192f81f03..41640494a 100644 --- a/runestone/assess/js/fitb.js +++ b/runestone/assess/js/fitb.js @@ -250,7 +250,7 @@ FITB.prototype.checkFITBStorage = function () { // Starts chain of functions which ends with feedBack() displaying feedback to user this.evaluateAnswers(); this.renderFITBFeedback(); - var answerInfo = "answer:" + this.given_arr + ":" + (this.isCorrect ? "correct" : "no"); + var answerInfo = "answer:" + this.given_arr + ":" + (this.correct ? "correct" : "no"); this.logBookEvent({"event": "fillb", "act": answerInfo, "div_id": this.divid}); this.enableCompareButton.disabled = false; }; diff --git a/runestone/parsons/js/parsons.js b/runestone/parsons/js/parsons.js index 0dbf640b9..42a82764d 100644 --- a/runestone/parsons/js/parsons.js +++ b/runestone/parsons/js/parsons.js @@ -799,7 +799,8 @@ if (codestring) { // Consecutive lines to be dragged as a single block of code have strings "\\n" to // represent newlines => replace them with actual new line characters "\n" - this.code = codestring.replace(/#distractor\s*$/, "").replace(trimRegexp, "$1").replace(/\\n/g, "\n"); + //codestring = codestring.replace(/\\n\s+/g,"\\n"); // remove leading spaced if more than one line in a code block - added in below to not change the codestring + this.code = codestring.replace(/#distractor\s*$/, "").replace(trimRegexp, "$1").replace(/\\n\s+/g,"\\n").replace(/\\n+/g,"\n"); this.indent = codestring.length - codestring.replace(/^\s+/, "").length; } };