assets/javascript/app.js
// function to change question upon choosing an answer choice until all questions have been used
function to change question upon choosing an answer choice until all questions have been used
function to change question upon choosing an answer choice until all questions have been used
function dispalyNextQuestion() {
    percent = Math.round(((questionCounter + 1) / questions.length) * 100);
    $('.progress-bar')
      .css('width', percent + '%')
      .attr('aria-valuenow', percent)
      .text(percent + '%');
    clearInterval(interval);
    counter = time;
    questionCounter++;
    if (questionCounter < questions.length) {
      setTimeout(function() {
        displayQuestion();
        timer();
      }, 1000 * 5);
    } else {
      clearInterval(interval);
      counter = time;
      setTimeout(lastPage, 5 * 1000);
    }
  }
function dispalyNextQuestion ( ) { percent = Math . round ( ( ( questionCounter + 1 ) / questions . length ) * 100 ) ; $ ( '.progress-bar' ) . css ( 'width' , percent + '%' ) . attr ( 'aria-valuenow' , percent ) . text ( percent + '%' ) ; clearInterval ( interval ) ; counter = time ; questionCounter ++ ; if ( questionCounter < questions . length ) { setTimeout ( function ( ) { displayQuestion ( ) ; timer ( ) ; } , 1000 * 5 ) ; } else { clearInterval ( interval ) ; counter = time ; setTimeout ( lastPage , 5 * 1000 ) ; } }
function to change question upon choosing an answer choice until all questions have been used
function to change question upon choosing an answer choice until all questions have been used
// display progress bar