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

Commit

Permalink
Fix: voteNum message
Browse files Browse the repository at this point in the history
  • Loading branch information
bnmnetp committed Jul 30, 2022
1 parent 5d3ffab commit 0e1fec2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion static/js/peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function connect(event) {
if (typeof currAnswer === "undefined") {
messarea.innerHTML = `<h3>You have not answered the question</h3><p>You will not be able to participate in any discussion unless you answer the question.</p>`;
} else {
if (voteNum < 2) {
if (getVoteNum() < 2) {
messarea.innerHTML = `<h3>Please Give an explanation for your answer</h3><p>Then discuss your answer with your group members</p>`;
} else {
messarea.innerHTML = `<h3>Voting for this question is complete</h3>`;
Expand Down Expand Up @@ -141,6 +141,16 @@ function connect(event) {
};
}

function getVoteNum() {
if (typeof voteNum !== "undefined") {
return voteNum;
} else if (typeof studentVoteCount !== "undefined") {
return studentVoteCount;
} else {
throw "Both voteNum and studentVoteCount are undefined";
}
}

function answerToString(currAnswer) {
const ordA = 65;
if (currAnswer.indexOf(",") > -1) {
Expand Down
4 changes: 3 additions & 1 deletion views/peer/peer_question.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ <h2>Peer Instruction: {{=assignment_name}}</h2>
var currentQuestion = '{{=XML(current_question.name)}}';
document.addEventListener("DOMContentLoaded", function (event) {
setTimeout(connect, 1000);
window.mcList[currentQuestion].submitButton.innerHTML = "Submit";
setTimeout(function () {
window.mcList[currentQuestion].submitButton.innerHTML = "Submit";
}, 1000);
});
var studentVoteCount = 1;
</script>

0 comments on commit 0e1fec2

Please sign in to comment.