I am trying to an online test sample applicatio with java script & I am facing some problem with the increment value of correct variable .The result of the increment value showing some strange value. If anyone can help me i can give y whole demo code
function checkAnswer(result,id,corrected)
   {
    var value;
      var choice=document.getElementsByName('choice');
      for(var i=0;i<choice.length;i++)                               //checkAnswer() function e problem ache 
      {
        if(choice[i].checked)
        {
           value=choice[i].value;
        }
      }  
        if(value===result)
        {
          corrected++;
        }
        if(id==last)
      {
        databox.innerHTML='<h3> You have given '+corrected+' correct answers out of '+last;
      }
   }
 
     
    