Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit c01d86a

Browse files
authored
Merge pull request #227 from flysaiah/timedFixes
Timed fixes
2 parents 4466fce + cab3c7c commit c01d86a

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

runestone/activecode/js/timed_activecode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ TimedActiveCode.prototype.processTimedSubmission = function (logFlag) {
5151
if (this.useRunestoneServices) {
5252
if (logFlag) {
5353
this.saveEditor();
54+
this.runProg();
5455
} else {
5556
this.loadEditor().done(this.runProg.bind(this));
5657
}

runestone/assess/js/mchoice.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ MultipleChoice.prototype.randomizeAnswers = function () {
279279

280280
MultipleChoice.prototype.restoreAnswers = function (data) {
281281
// Restore answers from storage retrieval done in RunestoneBase
282+
// sometimes data.answer can be null
283+
if (!data.answer) {
284+
data.answer = "";
285+
}
282286
var answers = data.answer.split(",");
283287
for (var a = 0; a < answers.length; a++) {
284288
var index = answers[a];

runestone/dragndrop/js/dragndrop.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ DragNDrop.prototype.setEventListeners = function (dgSpan, dpSpan) {
244244
}.bind(this));
245245
};
246246
DragNDrop.prototype.renderFeedbackDiv = function () {
247-
this.feedBackDiv = document.createElement("div");
248-
this.feedBackDiv.id = this.divid + "_feedback";
249-
this.containerDiv.appendChild(document.createElement("br"));
250-
this.containerDiv.appendChild(this.feedBackDiv);
247+
if (!this.feedBackDiv) {
248+
this.feedBackDiv = document.createElement("div");
249+
this.feedBackDiv.id = this.divid + "_feedback";
250+
this.containerDiv.appendChild(document.createElement("br"));
251+
this.containerDiv.appendChild(this.feedBackDiv);
252+
}
251253
};
252254
/*=======================
253255
== Auxiliary functions ==
@@ -342,6 +344,9 @@ DragNDrop.prototype.dragEval = function (logFlag) {
342344
};
343345

344346
DragNDrop.prototype.renderFeedback = function () {
347+
if (!this.feedBackDiv) {
348+
this.renderFeedbackDiv();
349+
}
345350
this.feedBackDiv.style.display = "block";
346351
if (this.correct) {
347352
$(this.feedBackDiv).html("You are correct!");

0 commit comments

Comments
 (0)