diff --git a/runestone/activecode/js/timed_activecode.js b/runestone/activecode/js/timed_activecode.js index bad8e3e47..fca2eb9c0 100644 --- a/runestone/activecode/js/timed_activecode.js +++ b/runestone/activecode/js/timed_activecode.js @@ -51,6 +51,7 @@ TimedActiveCode.prototype.processTimedSubmission = function (logFlag) { if (this.useRunestoneServices) { if (logFlag) { this.saveEditor(); + this.runProg(); } else { this.loadEditor().done(this.runProg.bind(this)); } diff --git a/runestone/assess/js/mchoice.js b/runestone/assess/js/mchoice.js index 60d7a6060..d2a1e4434 100644 --- a/runestone/assess/js/mchoice.js +++ b/runestone/assess/js/mchoice.js @@ -279,6 +279,10 @@ MultipleChoice.prototype.randomizeAnswers = function () { MultipleChoice.prototype.restoreAnswers = function (data) { // Restore answers from storage retrieval done in RunestoneBase + // sometimes data.answer can be null + if (!data.answer) { + data.answer = ""; + } var answers = data.answer.split(","); for (var a = 0; a < answers.length; a++) { var index = answers[a]; diff --git a/runestone/dragndrop/js/dragndrop.js b/runestone/dragndrop/js/dragndrop.js index 673e606be..12a2b4791 100644 --- a/runestone/dragndrop/js/dragndrop.js +++ b/runestone/dragndrop/js/dragndrop.js @@ -244,10 +244,12 @@ DragNDrop.prototype.setEventListeners = function (dgSpan, dpSpan) { }.bind(this)); }; DragNDrop.prototype.renderFeedbackDiv = function () { - this.feedBackDiv = document.createElement("div"); - this.feedBackDiv.id = this.divid + "_feedback"; - this.containerDiv.appendChild(document.createElement("br")); - this.containerDiv.appendChild(this.feedBackDiv); + if (!this.feedBackDiv) { + this.feedBackDiv = document.createElement("div"); + this.feedBackDiv.id = this.divid + "_feedback"; + this.containerDiv.appendChild(document.createElement("br")); + this.containerDiv.appendChild(this.feedBackDiv); + } }; /*======================= == Auxiliary functions == @@ -342,6 +344,9 @@ DragNDrop.prototype.dragEval = function (logFlag) { }; DragNDrop.prototype.renderFeedback = function () { + if (!this.feedBackDiv) { + this.renderFeedbackDiv(); + } this.feedBackDiv.style.display = "block"; if (this.correct) { $(this.feedBackDiv).html("You are correct!");