You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 30, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: static/js/peer.js
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ function connect(event) {
55
55
if(typeofcurrAnswer==="undefined"){
56
56
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>`;
57
57
}else{
58
-
if(voteNum<2){
58
+
if(getVoteNum()<2){
59
59
messarea.innerHTML=`<h3>Please Give an explanation for your answer</h3><p>Then discuss your answer with your group members</p>`;
60
60
}else{
61
61
messarea.innerHTML=`<h3>Voting for this question is complete</h3>`;
@@ -141,6 +141,16 @@ function connect(event) {
141
141
};
142
142
}
143
143
144
+
functiongetVoteNum(){
145
+
if(typeofvoteNum!=="undefined"){
146
+
returnvoteNum;
147
+
}elseif(typeofstudentVoteCount!=="undefined"){
148
+
returnstudentVoteCount;
149
+
}else{
150
+
throw"Both voteNum and studentVoteCount are undefined";
0 commit comments