var ans = new Array;
var done = new Array;
var yourAns = new Array;
var explainAnswer = new Array;

var score = 0;
ans[1] = "c";
ans[2] = "d";
ans[3] = "c";
ans[4] = "d";
ans[5] = "b";
ans[6] = "b";

explainAnswer[1]="The Multiple Listing Service is a comprehensive list of homes for sale in a defined area that are represented by realtors.";
explainAnswer[2]="All of the above. The value of any property is the amount an informed buyer will pay for it. And the amount buyers will pay can be determined by comparing sale prices of similar properties and understanding market conditions. ";
explainAnswer[3]="Right at sale price. It is better to list your home right at the price level you expect to receive. Pricing too low will short-change you; pricing it too high could lengthen the time it takes to sell.";
explainAnswer[4]="All of the above. It is important to present your home at its best. ";
explainAnswer[5]="As little as possible. Your house should be made presentable and all systems should be in good working order. But money invested in cosmetics is rarely recovered in a higher selling price.";
explainAnswer[6]="No. It is better to list your home for sale first. It is not a good idea to put yourself in a must-sell posture, which is what would happen if you committed yourself to a new home before your old one is sold. ";

function Engine(question, answer) {
yourAns[question]=answer;
}

function Score(){
var answerText = "How did you do?\n------------------------------------\n";
for(i=1;i<=6;i++){
   answerText=answerText+"\nQuestion :"+i+"\n";
  if(ans[i]!=yourAns[i]){
    answerText=answerText+"\nThe correct answer was "+ans[i]+"\n"+explainAnswer[i]+"\n";
  }
  else{
    answerText=answerText+" \nCorrect! \n";
    score++;
  }
}

answerText=answerText+"\n\nYour total score is : "+score+"\n";

//now score the user
answerText=answerText+"\nComment : ";
if(score<=0){
answerText=answerText+"I advise you to contact an agent to assist you with selling your home.";
}
if(score>=1 && score <=1){
answerText=answerText+"I advise you to contact an agent to assist you with selling your home. ";
}
if(score>=2 && score <=2){
answerText=answerText+"I advise you to contact an agent to assist you with selling your home. ";
}
if(score>=3 && score <=3){
answerText=answerText+"That could have went better. Please let me use my experience to assist you. ";
}
if(score>=4 && score <=4){
answerText=answerText+"Good Job. Call me, and I can advise you for smoother sale. ";
}
if(score>=5 && score <=5){
answerText=answerText+"Good Job. Call me, and I can advise you for smoother sale. ";
}
if(score>=6 && score <=6){
answerText=answerText+"Excellent. Call me today and get a Free Home Market evaluation. ";
}


alert(answerText);

}
