Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runestone/activecode/js/timed_activecode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
4 changes: 4 additions & 0 deletions runestone/assess/js/mchoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
13 changes: 9 additions & 4 deletions runestone/dragndrop/js/dragndrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==
Expand Down Expand Up @@ -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!");
Expand Down