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

Commit

Permalink
show feedback after async 2nd vote
Browse files Browse the repository at this point in the history
  • Loading branch information
bnmnetp committed Mar 31, 2023
1 parent fe7a9c1 commit b3aa324
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions runestone/mchoice/js/mchoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default class MultipleChoice extends RunestoneBase {
this.randomizeAnswers();
}
let self = this;
let answerFunc = function () {
let answerFunc = function() {
self.isAnswered = true;
};
for (var j = 0; j < this.answerList.length; j++) {
Expand Down Expand Up @@ -217,15 +217,15 @@ export default class MultipleChoice extends RunestoneBase {
if (this.multipleanswers) {
this.submitButton.addEventListener(
"click",
function () {
function() {
this.processMCMASubmission(true);
}.bind(this),
false
);
} else {
this.submitButton.addEventListener(
"click",
function (ev) {
function(ev) {
ev.preventDefault();
this.processMCMFSubmission(true);
}.bind(this),
Expand All @@ -245,7 +245,7 @@ export default class MultipleChoice extends RunestoneBase {
this.compareButton.textContent = "Compare me";
this.compareButton.addEventListener(
"click",
function () {
function() {
this.compareAnswers(this.divid);
}.bind(this),
false
Expand Down Expand Up @@ -385,8 +385,15 @@ export default class MultipleChoice extends RunestoneBase {
}
} else {
// acknowledge submission
$(this.feedBackDiv).html("<p>Your Answer has been recorded</p>");
$(this.feedBackDiv).attr("class", "alert alert-info");
if (eBookConfig.peer &&
eBookConfig.peerMode === "async" &&
typeof studentVoteCount !== "undefined" &&
studentVoteCount > 1) {
this.renderMCMAFeedBack();
} else {
$(this.feedBackDiv).html("<p>Your Answer has been recorded</p>");
$(this.feedBackDiv).attr("class", "alert alert-info");
}
}
}

Expand Down Expand Up @@ -529,9 +536,15 @@ export default class MultipleChoice extends RunestoneBase {
this.enableMCComparison();
}
} else {
// acknowledge submission
$(this.feedBackDiv).html("<p>Your Answer has been recorded</p>");
$(this.feedBackDiv).attr("class", "alert alert-info");
if (eBookConfig.peer &&
eBookConfig.peerMode === "async" &&
typeof studentVoteCount !== "undefined" &&
studentVoteCount > 1) {
this.renderMCMAFeedBack();
} else {
$(this.feedBackDiv).html("<p>Your Answer has been recorded</p>");
$(this.feedBackDiv).attr("class", "alert alert-info");
}
}
}

Expand Down Expand Up @@ -690,8 +703,8 @@ export default class MultipleChoice extends RunestoneBase {
== Find the custom HTML tags and ==
== execute our code on them ==
=================================*/
$(document).on("runestone:login-complete", function () {
$("[data-component=multiplechoice]").each(function (index) {
$(document).on("runestone:login-complete", function() {
$("[data-component=multiplechoice]").each(function(index) {
// MC
var opts = {
orig: this,
Expand Down

0 comments on commit b3aa324

Please sign in to comment.