Ver Mensaje Individual
  #10 (permalink)  
Antiguo 30/06/2005, 16:07
furoya
(Desactivado)
 
Fecha de Ingreso: noviembre-2002
Ubicación: Ciudad Autónoma de Buenos Aires
Mensajes: 2.367
Antigüedad: 21 años, 6 meses
Puntos: 317
Viene del mensaje anterior

Código:
<html>
<head>
<HTA:APPLICATION
APPLICATIONNAME="Evaluador" ID="evHTA" BORDER="thick"
BORDERSTYLE="normal" CAPTION="yes" CONTEXTMENU="yes"
INNERBORDER="no" MAXIMIZEBUTTON="yes" MINIMIZEBUTTON="yes" 
NAVIGABLE="yes" ICON="WINMINE.EXE" SCROLL="yes" SCROLLFLAT="no"
SELECTION="yes" SHOWINTASKBAR="yes" SINGLEINSTANCE="yes"
SYSMENU="yes" VERSION="0.1" WINDOWSTATE="maximize" />

<title>EVALUADOR. </title>
<script language= "JavaScript">

var hoy = new Date();
var dia = hoy.getDate();
var mes = hoy.getMonth();
var anio = hoy.getFullYear();
var correctas = "";
var revBIN = "";
var revCorrectas = "";
var temp = "";
var lCorrectas;

function verDatos(){
if(document.getElementById("cuestionario").innerHTML != ""){
revBIN = "";
revCorrectas = "";

var datos0 = document.panel.dato.value;
	//CORTA LAS DISTINTAS CADENAS DE DATOS//
var datos1 = datos0.split("&");
document.panel.fecha.value = datos1[0];
document.panel.nomAp.value = datos1[1];
//document.getElementById("nombreApellido").innerHTML = datos1[1];
var DEC = datos1[2];

	//MUESTRA SUMA DE CUESTIONARIO//
document.panel.respuestas.value = DEC;

	//CONVIERTE SUMA CUESTIONARIO A BINARIO//
var BIN = (datos1[2]*1).toString(2);

	//INVIERTE EL ORDEN DE BIN//
var lBIN = BIN.length;
for (i=(lBIN*1-1); i>=0; i--){
revBIN += BIN.charAt(i);
}
	//MUESTRA BIN INVERTIDO//
document.panel.binarioCues.value = revBIN;

	//INVIERTE EL ORDEN DE RESPUESTAS CORRECTAS EN BINARIO//
var correctas = (document.panel.binCorr.value);
lCorrectas = correctas.length;
for (i=(lCorrectas*1-1); i>=0; i--){
revCorrectas += correctas.charAt(i);
}

	//PONE RESPUESTAS CORRECTAS EN BINARIO INVERTIDAS//
document.panel.binarioCorr.value = revCorrectas;

	//COMPARA CUESTIONARIO Y RESPUESTAS//
for(b=0; b<lCorrectas-1; b++){
	//IDENTIFICA EL INPUT//
var botonRadio = document.getElementById( "cuestionario" ).getElementsByTagName( "input" )[b];
	//LE QUITA EL COLOR//
botonRadio.style.background = "none";

	//SI EL CUESTIONARIO ESTÁ TILDADO, COPIA CHECKED// 
 if(revBIN.charAt(b) == 1){
  botonRadio.setAttribute("checked","checked");
	//SI ES CORRECTO, PINTA DE VERDE//
   if(revCorrectas.charAt(b) == 1)  botonRadio.style.background = "#008000";
	//SI ES INCORRECTO, PINTA DE ROJO//
   else  botonRadio.style.background = "#ff0000";
 }
	//PINTA LA RESPUESTA CORRECTA DE AZUL//
 else if(revCorrectas.charAt(b) == 1)  botonRadio.style.background = "#000080";
}
}
else alert("No hay cuestionario !")
}

	//PARA CAMBIAR EL FORMATO DE LOS BOTONES//
function cambiar(D,B){
document.getElementById("CALIFICAR").style.display = "none"
document.getElementById("CREAR").style.display = "none"
document.getElementById("PUNTUAR").style.display = "none"
document.getElementById(""+D+"").style.display = "block"
document.getElementById("bCalificar").style.background = "#ffffff"
document.getElementById("bCrear").style.background = "#ffffff"
document.getElementById("bPuntuar").style.background = "#ffffff"
document.getElementById(""+B+"").style.background = "buttonface"
}

function escribeNuevo(){
	//MUESTRA EL CONTENIDO DEL TEXTAREA EN HTML//
document.getElementById("cuestionario").innerHTML = document.panel.cuestBlanco.value;
}


var valores = 1;
var contCuestionarioFinal = "";

	//PARTES DEL NUEVO DOCUMENTO A ABRIR//
var alfa ='<html><head><title>';

var bravo = "Cuestionario.";

var charly = ' </title>'+
'<script language= \"JavaScript\">'+
'var total=\"\";'+
'var autor=\"\";'+
'var fecha = new Date();'+
'var hoy = \"\";'+
'function suNombre(){'+
'autor = prompt(\"Escriba aquí su nombre y apellido\", \"\");'+
'document.getElementById(\"nombreApellido\").innerHTML = autor;'+
'total = document.formulario.getElementsByTagName(\"input\").length;'+
'}'+
'function generaValor(){'+
'var valores = \"\";'+
'for(r=0; r<total; r++){'+
'if(document.formulario.getElementsByTagName(\"input\")[r].type == \"radio\" && document.formulario.getElementsByTagName(\"input\")[r].checked)'+
'valores = ((valores*1) + (document.formulario.getElementsByTagName(\"input\")[r].value)*1);'+
'}'+
'hoy = fecha.toLocaleString();'+
'prompt(\"Copie el texto para imprimir o enviar.\" , hoy +\"&\"+ autor +\"&\"+ valores);'+
'}'+
'<\/script></head><body onload=\"suNombre()\">'+
'<h2>';

var delta = "Cuestionario.";

var eco = '</h2>'+
'<div id=\"contForm\">'+
'<h2 id=\"nombreApellido\"></h2>'+
'<form name=\"formulario\">'+
'\r\n\r\n\t<!-- DESDE AQUI SUS OPCIONES -->\r\n\r\n';

var foxtrot = '\r\n\r\n\t<!-- HASTA AQUI SUS OPCIONES -->\r\n\r\n'+
'<hr>Revise que todas las respuesas tengan un \"<input type=\"radio\" name=\"RFinal\" checked=\"checked\" />\" tildado antes de guardar los resultados.';

var golf = '</form></div>'+
'<input type=\"button\" value=\"Abre Resultados Para Guardar\" onclick=\"generaValor()\">'+
'</body></html>';
	//FIN DE LAS PARTES A ABRIR//

function abreNuevo(){
	//AGREGA EL INPUT "FINAL"//
var contCuestionario = document.panel.cuestBlanco.value + foxtrot;
	//AGREGA ATRIBUTO "VALUE" A CADA INPUT//
var buscar = /<input/g;
contCuestionario = contCuestionario.replace(buscar , "<input value=\"ñÑñ\"")

contCuestionario = contCuestionario.split("ñÑñ")

contCuestionarioFinal = contCuestionario[0];

	//AGREGA EL VALOR A CADA "VALUE"//
for (a=1; a<(contCuestionario.length); a++){
contCuestionarioFinal += (valores + contCuestionario[a])
valores = valores*2;
}

valores = 1;

	//ABRE EL NUEVO CUESTIONARIO JUNTANDO TODAS LAS PARTES//
var nuevaVentana = open("","NV","");
nuevaVentana.document.write (alfa + bravo + charly + delta + eco + contCuestionarioFinal + golf);
nuevaVentana.document.close();
}


function verPuntos(){
if(document.getElementById("cuestionario").innerHTML != ""){
var totalInput = document.getElementById("cuestionario").getElementsByTagName("input").length;
var sumaValores = 0;
var cadaValor = 1;

	//GUARDA PUNTAJE SI ESTÁ TILDADO//
for(r=0; r<totalInput; r++){
if(document.getElementById( "cuestionario" ).getElementsByTagName( "input" )[r].checked){
sumaValores = (sumaValores*1) + (cadaValor*1);
}
cadaValor = cadaValor*2;
}

	//MUESTRA LOS VALORES//
var sumaDecimal = (sumaValores + cadaValor);
var sumaBinario = sumaDecimal.toString(2)
document.panel.puntajeDec.value = sumaDecimal;
document.panel.puntajeBin.value = sumaBinario;
cadaValor = 1;
}
else alert("No hay cuestionario !");
}


function copiar(T){
T.select();
document.execCommand('copy');
}

	//ASIGNA TÍTULOS PARA RECONOCER EL DOCUMENTO//
function poneTitulos(){
var titGeneral = "Cuestionario-"+dia+"-"+mes+"-"+anio+".";
var titBarra = prompt("Escriba un texto para la Barra de Título.", titGeneral);

if(titBarra == null){titBarra = "";}

var titCuest = prompt("Escriba un texto para el título del cuestionario.", titBarra);

if(titCuest == null || titCuest == ""){titCuest = titGeneral;}

bravo = titBarra;
delta = titCuest;

document.panel.abrenuevo.disabled = false;
}
</script>
<style>
#cuestBlanco{width:100%; height:80%; }
#CALIFICAR, #CREAR, #PUNTUAR{width:100%; height:50%; display:none; overflow:auto; }
#bCalificar, #bCrear, #bPuntuar{background:#ffffff; width:33%; }
#CREAR{display:block; }
#bCrear{background:buttonface; }
.rojo{background:#ff0000; }
.verde{background:#008000; }
.azul{background:#000080; }

</style>
</head>
Continúa en el mensaje siguiente