// JavaScript Document

<!--  



// Insert number of questions
var numQues = 13;

// Insert number of choices in each question
var numChoi = 2;

// Insert number of questions displayed in answer area
var answers = new Array(13);

// Insert answers to questions
answers[0] = "a";
answers[1] = "b";
answers[2] = "c";
answers[3] = "d";
answers[4] = "e";
answers[5] = "f";
answers[6] = "g";
answers[7] = "h";
answers[8] = "i";
answers[9] = "j";
answers[10] = "k";
answers[11] = "l";
answers[12] = "m";


function getScore(form) {
  var score = 0;
  var currElt;
  var currSelection;
  for (i=0; i<numQues; i++) {
    currElt = i*numChoi;
    for (j=0; j<numChoi; j++) {
      currSelection = form.elements[currElt + j];
      if (currSelection.checked) {
        if (currSelection.value == answers[i]) {
          score++;
          break;
        }
      }
    }
  }
  score = Math.round(score/numQues*100);
  
 if (score < 18 ) {
	  window.location="Cheating_Boyfriend_Test-1.html"
	  }
 
 
 
 else if ( score >= 18  && score < 66 ) {
   window.location="Cheating_Boyfriend_Test-2.html"
	
	
	}
 
 else if ( score >= 66  && score <=100 ) {
   window.location="Cheating_Boyfriend_Test-3.html"
	
	
	}
 
 
//  End -->
}


