reveal tier scores only up to next question

This commit is contained in:
Astro 2011-11-28 02:44:34 +01:00
parent a3ea4da327
commit 19c5db0c5b
1 changed files with 9 additions and 5 deletions

14
quiz.js
View File

@ -169,11 +169,6 @@ function startQuiz() {
var i;
console.log('startQuiz');
questions.forEach(function(q) {
$('#tiers').append('<li></li>');
$('#tiers li').last().text(q.tier);
});
updateScores();
$('#setup').fadeOut(700, function() {
@ -221,6 +216,14 @@ function updateScores() {
$('#players .player' + i).hide();
}
}
/* Update tiers */
$('#tiers').empty();
for(i = 0; i < questions.length; i++) {
var text = i <= currentQuestion ? questions[i].tier : "?";
$('#tiers').append('<li></li>');
$('#tiers li').last().text(text);
}
}
function censorIrcMessage(text) {
@ -488,6 +491,7 @@ function switchToGame() {
if (key === " ") {
// next question:
currentQuestion++;
updateScores();
saveGamestate();
$('#game').fadeOut(500, function() {
switchToScoreboard();