r = new Array(30);

function inizializza() {
  for (i=1; i <= 30; i++) {
    r[i] = 0;
  }
}

function calcola() {

var risposte = 0;
var errori = 0;
var errors = "";

  for (i=1; i <= 30; i++) {
  
  if ( r[i] == 0 )
     
    { errors=errors + i + ")   " ;
      errori = errori + 1;
    } 
      else {risposte = risposte + r[i]} ;  
  }


if ( errori == 0 ) {  
if ((primotentativo>=0) && (primotentativo <=7)){
  this.location.replace("_risultato.php?risultato=ax")
}

if ((primotentativo>=8) && (primotentativo <=15)){
  this.location.replace("_risultato.php?risultato=by")
}

if ((primotentativo>=16) && (primotentativo <=23)){
  this.location.replace("_risultato.php?risultato=cz")
}

if ((primotentativo>=24) && (primotentativo <=30)){
  this.location.replace("_risultato.php?risultato=dz")

}
}
else  { 
		if ( errori >= 2 ) {
  		window.alert("Non hai risposto alle domande n°  " + errors )
		} else {
  		window.alert("Non hai risposto alla domanda n°  " + errors )
  		}
	}
}


var primotentativo=0

function checkme(notentativi, sgiusta, cgiusta)  {

  	if (sgiusta==cgiusta) {
  					if (notentativi==1)  {
  						primotentativo+=1;
  						document.status.esatte.value=(primotentativo)};
  					return " Corretto"}
 				else {
 					return " Riprova"}
					}

//  -->


