var ans = new Array;
var done = new Array;
var yourAns = new Array;
var explainAnswer = new Array;

var score = 0;
ans[1] = "c";
ans[2] = "a";
ans[3] = "d";
ans[4] = "a";
ans[5] = "d";

explainAnswer[1]="Incorrect!";
explainAnswer[2]="Incorrect!";
explainAnswer[3]="Incorrect!";
explainAnswer[4]="Incorrect!";
explainAnswer[5]="Incorrect!";

function Engine(question, answer) {
yourAns[question]=answer;
}

function Score(){
var answerText = "How did you do?\n__________________________________\n";
for(i=1;i<=5;i++){
   answerText=answerText+"\nQuestion :"+i+"\n";
  if(ans[i]!=yourAns[i]){
    answerText=answerText+"\n"+explainAnswer[i]+"\nThe correct answer is ("+ans[i]+")\n";
  }
  else{
    answerText=answerText+" \nCORRECT - Well Done \n";
    score++;
  }
}

answerText=answerText;

//now score the user
answerText=answerText+"__________________________________\n\n";
if(score<=0){
answerText=answerText+"Now that you've got that behind you, \nhow about trying another level or quiz?";
}
if(score>=1 && score <=2){
answerText=answerText+"Now that you've got that behind you, \nhow about trying another level or quiz?";
}
if(score>=3 && score <=3){
answerText=answerText+"Now that you've got that behind you, \nhow about trying another level or quiz?";
}
if(score>4){
answerText=answerText+"Now that you've got that behind you, \nhow about trying another level or quiz?";
}

alert(answerText);

}
