Code
function returnScore()
{
//Calls answers from the form and stores them into variables
var answer1=document.forms['questions']['answer1'].value;
var answer2=document.forms['questions']['answer2'].value;
var answer3=document.forms['questions']['answer3'].value;
//Sets score to 0
var score = 0;
if(answer1 == 'var')
{
score++;
}
if(answer2 == 'script' || answer2 == 'script' )
{
score++;
}
if(answer3 == 'int' || answer3 == 'integer' )
{
score++;
}
window.alert("Your total score is: " + score);
}