///////////////////////////////////////////////////////////////
//  This JavaScript grades quiz 8 for Physics 1408 from HRW
//                thomas l. gibson  June 7, 2003
//////////////////////////////////////////////////////////////
var score;
var hit = new Array(0,0,0); 

function bullsEye(index)
{
  hit[index] = 10;
  alert("Correct! But, are there any more?");
  return;
}
function gradeIt(theForm) {
  var grade = 0;
  var max = 30.0;
  with (document.forms[0])
  {
    for (var i = 0; i < 3; i++) 
    {
      grade += hit[i];
    }
  }
  var real = grade/max * 100;
  score = Math.ceil(real);              // Round score upward
  if ((score - real) > 0.5)             // Round score downward
  {
    score -= 1;
  }
  alert("Your score is " + score);
}
