function validar1(){
var fallos =0;
var respondidas=0;

   if (document.forms["test1"].elements["planta1"].value!=3) fallos=fallos+1;
   if (document.forms["test1"].elements["planta2"].value!=49) fallos=fallos+1;
   if (document.forms["test1"].elements["planta3"].value!=16) fallos=fallos+1;
   if (document.forms["test1"].elements["planta4"].value!=53) fallos=fallos+1;
   if (document.forms["test1"].elements["planta5"].value!=21) fallos=fallos+1;
   if (document.forms["test1"].elements["planta6"].value!=18) fallos=fallos+1;
   
   if (document.forms["test1"].elements["planta1"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta2"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta3"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta4"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta5"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta6"].value!=0) respondidas++;
      
   if (respondidas!=6) alert("Debes responder todas las preguntas antes de comprobarlas."); 
   else{
     if (fallos==0) alert ("Enhorabuena, has respondido correctamente todas las preguntas.");
      else{
		  if (fallos==1) alert("Lo siento, tienes "+fallos+" fallo. Intenta corregirlo.");
		   else{ alert("Lo siento, tienes "+fallos+" fallos. Intenta corregirlos.");}}}
		   
		   if ((fallos>0)&&(respondidas==6)) document.location.href=document.location.href;
}//de la funcion


function validar2(){
var fallos =0;
var respondidas=0;

   if (document.forms["test1"].elements["planta1"].value!=29) fallos=fallos+1;
   if (document.forms["test1"].elements["planta2"].value!=43) fallos=fallos+1;
   if (document.forms["test1"].elements["planta3"].value!=31) fallos=fallos+1;
   if (document.forms["test1"].elements["planta4"].value!=25) fallos=fallos+1;
   if (document.forms["test1"].elements["planta5"].value!=48) fallos=fallos+1;
   if (document.forms["test1"].elements["planta6"].value!=34) fallos=fallos+1;
   
   if (document.forms["test1"].elements["planta1"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta2"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta3"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta4"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta5"].value!=0) respondidas++;
   if (document.forms["test1"].elements["planta6"].value!=0) respondidas++;
      
   if (respondidas!=6) alert("Debes responder todas las preguntas antes de comprobarlas."); 
   else{
     if (fallos==0) alert ("Enhorabuena, has respondido correctamente todas las preguntas.");
      else{
		  if (fallos==1) alert("Lo siento, tienes "+fallos+" fallo. Intenta corregirlo.");
		   else{ alert("Lo siento, tienes "+fallos+" fallos. Intenta corregirlos.");}}}
		   
		   if ((fallos>0)&&(respondidas==6)) document.location.href=document.location.href;
}//de la funcion



