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

Commit 20dc162

Browse files
committed
deter users from moving on before voting twice
1 parent 77870c5 commit 20dc162

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

controllers/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# Third Party library
2424
# -------------------
25-
import boto3, botocore
25+
import boto3, botocore # for the S3 API
2626
from dateutil.parser import parse
2727
from rs_grading import _get_assignment, send_lti_grades
2828
from runestone import cmap

static/js/peer.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,13 @@ async function showPeerEnableVote2() {
433433
$(".runestone [type=radio]").prop("checked", false);
434434
$(".runestone [type=checkbox]").prop("checked", false);
435435
studentVoteCount += 1;
436+
studentSubmittedVote2 = false;
437+
let checkme = document.querySelector(".runestone button");
438+
if (checkme.innerHTML === "Check Me") {
439+
checkme.addEventListener("click", function (event) {
440+
studentSubmittedVote2 = true;
441+
});
442+
}
436443
}
437444

438445
$(function () {

views/peer/peer_async.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ <h4>A discussion for you to consider</h4>
5555
setTimeout(connect, 1000);
5656
});
5757
var studentVoteCount = 1;
58+
var studentSubmittedVote2 = false;
5859
var vote2done = false;
5960
var nextQuestionNumber = {{= nextQnum}};
6061
var assignId = '{{=assignment_id}}'
6162

6263
function checkVoteCount() {
63-
if (studentVoteCount < 2) {
64+
if (studentVoteCount < 2 || studentSubmittedVote2 == false) {
6465
alert("You must vote twice before moving on");
6566
return false;
6667
}

0 commit comments

Comments
 (0)