<!-- Copyright 2001 William Bontrager
// You may use this JavaScript code so long as the copyright line, the more info link, and 
//      the instructions remain with the code. For additional form creation and script 
//      customizing information, see the article "JavaScript Quiz Program" linked from 
//      http://willmaster.com/possibilities/archives/

// On the next line, specify the number of answer choices at each question:
NumChoices = 3;

// Leave next five lines as is.
function CalculateScore()
{
        var score = 0;
        for (i = 0; i < NumChoices; i++)
        {

// Begin calculation block.
// There should be one "if( ... value); }" line for each question. Each line needs to have the name 
//      of the form element specified in two places, in front of the open square brackets "["
                if(document.quizform.Q1[i].checked) { score += parseInt(document.quizform.Q1[i].value); }
                if(document.quizform.Q2[i].checked) { score += parseInt(document.quizform.Q2[i].value); }
                if(document.quizform.Q3[i].checked) { score += parseInt(document.quizform.Q3[i].value); }
                if(document.quizform.Q4[i].checked) { score += parseInt(document.quizform.Q3[i].value); }
// End calculation block.

// Leave the rest of the JavaScript code as is.
        }
        document.quizform.totalscore.value = score;
} // -->
