function checkAnswer(event) {
  clearInterval(intervalId);
  if (event.target.matches("li")) {
    var answer = event.target.textContent;
    if (answer === questions[questionIndex].answer) {
      questionResultEl.textContent = "Correct";
      correctCount++;
    } else {
      questionResultEl.textContent = "Incorrect";
      time = time - 4;
      timerEl.textContent = "Time: " + time;
    }
  }
  setTimeout(nextQuestion, 1000);
}
//verifies if quesiton is correct, deducts time if incorrect
verifies if quesiton is correct, deducts time if incorrect
verifies if quesiton is correct deducts time if incorrect
function checkAnswer(event) {
  clearInterval(intervalId);
  if (event.target.matches("li")) {
    var answer = event.target.textContent;
    if (answer === questions[questionIndex].answer) {
      questionResultEl.textContent = "Correct";
      correctCount++;
    } else {
      questionResultEl.textContent = "Incorrect";
      time = time - 4;
      timerEl.textContent = "Time: " + time;
    }
  }
  setTimeout(nextQuestion, 1000);
}
function checkAnswer ( event ) { clearInterval ( intervalId ) ; if ( event . target . matches ( "li" ) ) { var answer = event . target . textContent ; if ( answer === questions [ questionIndex ] . answer ) { questionResultEl . textContent = "Correct" ; correctCount ++ ; } else { questionResultEl . textContent = "Incorrect" ; time = time - 4 ; timerEl . textContent = "Time: " + time ; } } setTimeout ( nextQuestion , 1000 ) ; }
verifies if quesiton is correct, deducts time if incorrect
verifies if quesiton is correct deducts time if incorrect