diff --git a/falsch.ogg b/falsch.ogg new file mode 100644 index 0000000..f4bf885 Binary files /dev/null and b/falsch.ogg differ diff --git a/index.html b/index.html index 46412b2..ab5a5db 100644 --- a/index.html +++ b/index.html @@ -63,5 +63,11 @@
10
+ +
+
diff --git a/quiz.js b/quiz.js index f4ae218..63bd89c 100644 --- a/quiz.js +++ b/quiz.js @@ -337,7 +337,7 @@ function switchToGame() { liEl.fadeTo(0, 1); } - var switchToAnswer = function() { + var switchToAnswer = function(isTimeout) { if (activePlayer !== null) { // player confirmed answer or gave up var answerEl; @@ -348,12 +348,16 @@ function switchToGame() { var isRight = choice !== null && q.answers[choice].right === true; if (isRight) { playerScores[activePlayer] += q.tier; + + $('#audio_right')[0].play(); } else { playerScores[activePlayer] -= q.tier; if (choice !== null) // Hilight the wrong choice answerEl.addClass('wrong'); + if (!isTimeout) + $('#audio_wrong')[0].play(); } } else { @@ -363,6 +367,8 @@ function switchToGame() { playerScores[i] -= q.tier; } } + if (!isTimeout) + $('#audio_wrong')[0].play(); } updateScores(); timer.halt(); @@ -387,7 +393,11 @@ function switchToGame() { } }; }; - timer.set(TIMER_QUESTION, switchToAnswer); + var timeout = function() { + $('#audio_timeout')[0].play(); + switchToAnswer(true); + }; + timer.set(TIMER_QUESTION, timeout); keyHandler = function(key, keyCode) { if (keyCode === 27) { @@ -401,7 +411,7 @@ function switchToGame() { if (playerNames[player]) { activePlayer = player; updateTier(); - timer.set(TIMER_ANSWER, switchToAnswer); + timer.set(TIMER_ANSWER, timeout); } } else if (activePlayer !== null && "1234".indexOf(key) >= 0) { diff --git a/richtig.ogg b/richtig.ogg new file mode 100644 index 0000000..49f76da Binary files /dev/null and b/richtig.ogg differ diff --git a/timeout.ogg b/timeout.ogg new file mode 100644 index 0000000..c316d32 Binary files /dev/null and b/timeout.ogg differ