﻿/* ThinkQuest International 2006/2007
   TQ Toolkit - A web building guide for ThinkQuesters (C)
   Your TQ Guides (R)
   Visit http://library.thinkquest.org/06aug/02048/

*/

var ans = new Array;
var yourAns = new Array;

var score = 0;
ans[1] = "C \n The year was 1908";
ans[2] = "D \n The year was 1928";
ans[3] = "A \n The year was 1946";
ans[4] = "C \n The month was January";
ans[5] = "A \n The year was 1957";
ans[6] = "D \n The year was 1540";
ans[7] = "B \n The year was 1599";
ans[8] = "B \n The approximate year was 60 AD";
ans[9] = "C \n The year was 2000";
ans[10] = "B \n The year was 1960";


function Engine(question, answer) {
	yourAns[question]=answer;
}

function Score(){
var answerText = "How did you do?\n-------------------------------------------------------\n";
for(i=1;i<=10;i++){
   answerText=answerText+"Question "+i + ": ";
  if(ans[i]!=yourAns[i]){
    answerText=answerText+"Oops! The correct answer was "+ans[i]+"\n";
  }
  else{
    answerText=answerText+" Correct! \n";
    score++;
  }
}

answerText=answerText+"\nYour total score is : "+score+"\n";

//now score the user
answerText=answerText+"Comment : ";
if(score==0){
answerText=answerText+"Are you sure you read the content?";
}
if(score>1 && score <7){
answerText=answerText+"You may need to review the content";
}
if(score==7){
answerText=answerText+"Acceptable!";
}
if(score>=8 && score <=9){
answerText=answerText+"Doing Well!";
}
if(score>=9){
answerText=answerText+"You're an expert in Site Content!";
}

alert(answerText);

}
