function select(answer) {
    $(answer + " div").click(function() {
      $(answer + " div").removeClass("highlight");
      $(this).addClass("highlight");
      if (answered.indexOf(answer) == -1) answered.push(answer);
      if (answered.length == 5) showResult();
    });
  }
// Check if all questions have been answered. If so, call the showResult function.
Check if all questions have been answered. If so, call the showResult function.
Check if all questions have been answered . If so call the showResult function .
function select(answer) {
    $(answer + " div").click(function() {
      $(answer + " div").removeClass("highlight");
      $(this).addClass("highlight");
      if (answered.indexOf(answer) == -1) answered.push(answer);
      if (answered.length == 5) showResult();
    });
  }
function select ( answer ) { $ ( answer + " div" ) . click ( function ( ) { $ ( answer + " div" ) . removeClass ( "highlight" ) ; $ ( this ) . addClass ( "highlight" ) ; if ( answered . indexOf ( answer ) == - 1 ) answered . push ( answer ) ; if ( answered . length == 5 ) showResult ( ) ; } ) ; }
Check if all questions have been answered.
Check if all questions have been answered .