assets/js/app.js
// This function handles a correct answer
This function handles a correct answer
This function handles a correct answer
function logCorrectAnswer(target) {
    disableChoices();
    clearInterval(questionTimer);
    target.classList.add('btn-success');
    score++;
    if (timeElapsed <= 5) {
        score++;
    }
    if (timeElapsed <= 2) {
        score++;
    }
    correctSound.play();
    nextQuestion();
}
function logCorrectAnswer ( target ) { disableChoices ( ) ; clearInterval ( questionTimer ) ; target . classList . add ( 'btn-success' ) ; score ++ ; if ( timeElapsed <= 5 ) { score ++ ; } if ( timeElapsed <= 2 ) { score ++ ; } correctSound . play ( ) ; nextQuestion ( ) ; }
This function handles a correct answer
This function handles a correct answer
// Disable the choices so user doesn't accidentally hit another button // Stop the question timer interval // Give them 1 point for answering correctly //If they answer within 5 seconds, give them a bonus point //Bonus bonus! // Play sound