///////////////////////////////////////////////////////////////
//  This JavaScript grades quiz 16 for Physics 1408
//                thomas l. gibson  June 22, 2005
//////////////////////////////////////////////////////////////
var score;
function gradeIt(theForm) 
{
  var answers = new Array(2,1,2,4,1,3,1,2,3,2,0,2);
  var grade = 0;
  var max = 120.0;
  with (document.forms[0]) 
  {
    for (var i = 0; i <= 11; i++) 
    {
      var albl = answers[i]
      if(elements[(i*5 + albl)].checked) 
      {
        grade += 10;
      }
    }
  }
  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);
}