punish all on timeout w/o buzzer press
This commit is contained in:
parent
bdeb456d0d
commit
888b1f3c08
16
quiz.js
16
quiz.js
|
@ -220,15 +220,24 @@ function switchToGame() {
|
|||
var isRight = choice !== null && q.answers[choice].right === true;
|
||||
if (isRight) {
|
||||
playerScores[activePlayer] += q.tier;
|
||||
updateScores();
|
||||
} else {
|
||||
playerScores[activePlayer] -= q.tier;
|
||||
updateScores();
|
||||
|
||||
if (choice !== null)
|
||||
// Hilight the wrong choice
|
||||
answerEl.addClass('wrong');
|
||||
}
|
||||
|
||||
} else {
|
||||
/* no player wanted to answer, punish all */
|
||||
for(var i = 0; i < playerNames.length; i++) {
|
||||
if (playerNames[i]) {
|
||||
playerScores[i] -= q.tier;
|
||||
}
|
||||
}
|
||||
}
|
||||
updateScores();
|
||||
|
||||
// Hilight all right choices
|
||||
var i = 0;
|
||||
q.answers.forEach(function(answer) {
|
||||
|
@ -246,9 +255,6 @@ function switchToGame() {
|
|||
});
|
||||
}
|
||||
};
|
||||
} else {
|
||||
/* TODO: punish all */
|
||||
}
|
||||
};
|
||||
timer.set(TIMER_QUESTION, switchToAnswer);
|
||||
|
||||
|
|
Loading…
Reference in New Issue