// JavaScript Document
var count=0,count1=0,count2=0,count3=0,count4=0;
var rightAns=0;
//function definition  for question1 starts here
function checkQ1()
  {
		question1=document.forms[0].question1; 
		//variable defined for each question using document.form object
     for (i=0;i<question1.length;++ i)
	 //on the basis of length (number of radio elements in a question)
		{
		  document.getElementById("qone"+i).disabled=true;//each element is now disable of that question
			 if (question1[i].checked) 
			 //if radio element (any option from answer) is selected 
			  {
				var b=question1[i].value; 
				//value of selected element stored in element
					  if(b=="a")
					  {
						document.getElementById("right").style.display='inline'; 
						document.getElementById('wrong').style.display='none';
						//on the correct answer table having correct answer is visible
						 count=1;
						 rightAns=1;
						 // variable is defined to calculate result (number of correct answer given)
						
					  }
					  else
					  {
						 document.getElementById("wrong").style.display='inline';
						 //on the incorrect answer table having corrected answer is visible
						 count=1;
					  }
				}
					  
			  if(count==0) //to disable radio element after submiting quiz and radio element (any option from answer) is not selected 
			  {
			  document.getElementById('wrong').style.display='inline';
			  count=0;
			  
			  }
		}
	
  }
 
//function definition  for question1 ends here
 //same as above for each question below function are defined.

//function definition  for question2 starts here
  function checkQ2()
  {
   question2=document.forms[0].question2;
     for (i=0;i<question2.length;++ i)
  {
 document.getElementById("qTwo"+i).disabled=true;
     if (question2[i].checked)
	  {
	    var b=question2[i].value;
		  if(b=="a")
		  {
		    document.getElementById("right1").style.display='inline';
			count1=1;
			rightAns=rightAns+1;
					  }
		  else
		  {
		   document.getElementById("wrong1").style.display='inline';
		   			count1=1;
		  }
		  	  }
			  
	  if(count1==0)
	  {
	  document.getElementById('wrong1').style.display='inline';
	  count1=0;
	  
	  }
	  }
	 
  }
  //function definition  for question2 ends here
  //function definition  for question3 starts here
    function checkQ3()
  {
   question3=document.forms[0].question3;
     for (i=0;i<question3.length;++ i)
  { document.getElementById("qThree"+i).disabled=true;
     if (question3[i].checked)
	  {
	    var b=question3[i].value;
		  if(b=="a")
		  {
		    document.getElementById("right2").style.display='inline';
            document.getElementById("wrong2").style.display='none';
			count2=1;
			rightAns=rightAns+1;
		  }
		  else
		  {
		   document.getElementById("wrong2").style.display='inline';
		   			count2=1;
		  }
		  	  }
			  
	  if(count2==0)
	  {
	  document.getElementById('wrong2').style.display='inline';
	  count2=0;
	  
	  }
	  }
	
  }
  //function definition  for question3 ends here
  //function definition  for question4 starts here
 function checkQ4()
  {
   question4=document.forms[0].question4;
     for (i=0;i<question4.length;++ i)
  {
document.getElementById("qFour"+i).disabled=true;
     if (question4[i].checked)
	  {
	    var b=question4[i].value;
		  if(b=="a")
		  {
		    document.getElementById("right3").style.display='inline';
			document.getElementById("wrong3").style.display='none';
			count3=1;
			rightAns=rightAns+1;
			
					  }
		  else
		  {
		   document.getElementById("wrong3").style.display='inline';
		   			count3=1;
		  }
		  	  }
			  
	  if(count3==0)
	  {
	  document.getElementById('wrong3').style.display='inline';
	  count3=0;
	  
	  }
	  }
	   document.getElementById('statement').style.display='none';
				 document.getElementById('result').style.display='inline';
			   document.getElementById('hidebtn').style.display='none';
			   document.getElementById('rt').innerText=rightAns;
  }
  //function definition  for question4 ends here
  //function definition  for question5 starts here
function checkQ5()
  {
    question5=document.forms[0].question5;
     for (i=0;i<question5.length;++ i)
   {
      document.getElementById("qFive"+i).disabled=true;
     if (question5[i].checked)
	  {
	    var b=question5[i].value;
		  if(b=="a")
		  {
		    document.getElementById("right4").style.display='inline';
			   document.getElementById("wrong4").style.display='none';
			count4=1;
			rightAns=rightAns+1;
			
		  }
		  else
		  {
		   document.getElementById("wrong4").style.display='inline';
		   count4=1;
		
		   			
		  }
	  }
			  
	  if(count4==0)
	  {
	  document.getElementById('wrong4').style.display='inline';
	  count4=0;
	  
	  }
	  }
		         
		  	     document.getElementById('statement').style.display='none';
				 document.getElementById('result').style.display='inline';
			   document.getElementById('hidebtn').style.display='none';
			   document.getElementById('rt').innerText=rightAns;
             
  }
//function definition  for question5 ends here
//to create SDC tag for result page
function sdcTagQuizResults() { 
                           dcsMultiTrack( 
                                  "DCS.dcsuri", "/shingles-symptoms-test-result.html", 
                                  "WT.ti", "Send to Friend Confirmation", 
                                  "DCS.dcsref", window.location.pathname, 
                                  "WT.tx_e", "", 
                                  "WT.tx_id", "", 
                                  "WT.tx_it", "", 
                                  "WT.tx_u", "", 
                                  "WT.pn_sku", "", 
                                  "WT.pi", "", 
                                  "WT.tx_s", "", 
                                  "DCSext.QualityIndex", ""); 
                        } 