// JavaScript Document
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";


explainAnswer[1]="Batata is the Portuguese word for potato, apparently from the Antillano batata. In some Arabic variants it is also the word for potato, even if potatis is more common. In Marathi, due to Portuguese influence, it also has the same meaning.";
explainAnswer[2]="The year 2008 was declared the International Year of the Potato by the United Nations, noting that the potato is a staple food in the diet of the worlds population, and affirming the need to focus world attention on the role that the potato can play in providing food security and eradicating poverty. Food and Agriculture Organization was invited to facilitate its implementation.";


function Engine(question, answer) {
yourAns[question]=answer;
}

function Score(){
var answerText = "How did you do?\n------------------------------------\n";
for(i=1;i<=2;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" +"\n"+explainAnswer[i]+"\n";
    score++;
  }
}

answerText=answerText+"\n\nYour total score is : "+score+"\n";

//now score the user
answerText=answerText+"\nComment : ";
if(score<=0){
answerText=answerText+"You need to learn more about Portuguese and Marathi";
}
if(score>=1 && score <=1){
answerText=answerText+"Learn a bit more about Potato";
}
if(score>=2 && score <=2){
answerText=answerText+"Perfect";
}
if(score>2){
answerText=answerText+"Perfect!";
}

alert(answerText);
score = 0;
}
//  End -->
