function saltar_seccion(cuales){ if(cuales==2){ seguiente_ibt_listening(); } if(cuales==3){ seguiente_ibt_speking(); } if(cuales==4){ seguiente_ibt_writing(); } } function abrir_review(){ document.getElementById('review_ibte').style.display='block'; document.getElementById('abrir_review').style.display='none'; document.getElementById('close_review').style.display='block'; } function cerrar_review(){ document.getElementById('review_ibte').style.display='none'; document.getElementById('close_review').style.display='none'; document.getElementById('abrir_review').style.display='block'; } function abrir_lectura_drag(){ document.getElementById('lectura_drag').style.display='block'; document.getElementById('abrir_lecdrag').style.display='none'; document.getElementById('cerrar_lecdrag').style.display='block'; } function cerrar_lectura_drag(){ document.getElementById('lectura_drag').style.display='none'; document.getElementById('cerrar_lecdrag').style.display='none'; document.getElementById('abrir_lecdrag').style.display='block'; } var myCounterbreak = new Countdown({ //prepara respuesta onUpdateStatus: function(sec){ console.log(sec); var tipograbaa = 600; var cuanto= sec / tipograbaa * 100; document.getElementById('barraprogreso_pp27').style.width=''+cuanto+'%'; document.getElementById('barraprogreso_pp27').innerHTML = ""+sec+" segundos"; }, onCounterEnd: function(){ seguiente_ibt();} // final action }); function muestra_oculta(){ document.getElementById('elbloc').style.display='none'; document.getElementById('elbloc1').style.display='block'; } function ancla(){ document.location.href = "#bar"; } function capa_uno(){ var cualaudio = document.getElementById("audiolistening").value; //Audio que se reproducira var carpeta = document.getElementById("carpeta233").value; var subcarpeta = document.getElementById("subcarpeta233").value; var audio = document.getElementById("reproductor99"); //Creamos Objeto del reproductor para manipularlo. audio.src = "http://toefl.pass-your.com/audio/ibt/"+carpeta+"/"+subcarpeta+"/"+cualaudio+".ogg"; audio.addEventListener("canplaythrough", function () { }, false); audio.addEventListener('ended', function () { document.getElementById('capa1').style.display ='none'; document.getElementById('capa2').style.display ='block'; }, false); audio.play(); // Play Audio document.getElementById('pad10').onmouseover = ""; //Borramos función en el div para que no se repita. :D #truco mike } function cortinilla_texto_audio(){ var cualaudio = document.getElementById("audiolistening23").value; //Audio que se reproducira var carpeta = document.getElementById("carpeta23").value; //Audio que se reproducira var subcarpeta = document.getElementById("subcarpeta23").value; //Audio que se reproducira var audio = document.getElementById("reproductor100"); //Creamos Objeto del reproductor para manipularlo. audio.src = "http://toefl.pass-your.com/audio/ibt/"+carpeta+"/"+subcarpeta+"/"+cualaudio+".ogg"; audio.addEventListener("canplaythrough", function () { }, false); audio.addEventListener('ended', function () { seguiente_ibt(); }, false); audio.play(); // Play Audio document.getElementById('pad10').onmouseover = ""; //Borramos función en el div para que no se repita. :D #truco mike } function showplop(cual){ document.getElementById('negro'+cual).style.display ='block'; for(i=1; i<=4; i++){ if(i!=cual){ document.getElementById('negro'+i).style.display ='none'; } } } function copiar(myField){ if (document.selection){ myField.focus(); sel = document.selection.createRange(); return sel.text; } else if (myField.selectionStart || myField.selectionStart == "0"){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; var hola = myField.value.substr(startPos, endPos - startPos); document.getElementById("campo_temp").value = hola; } else { return ""; } } function cortar(myField){ if (document.selection){ myField.focus(); sel = document.selection.createRange(); return sel.text; } else if (myField.selectionStart || myField.selectionStart == "0"){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; var hola = myField.value.substr(startPos, endPos - startPos); document.getElementById("campo_temp").value = hola; myField.value = myField.value.substr(0,startPos)+''+ myField.value.substr(endPos, myField.value.length); } else { return ""; } } function pegar(f,x){ var _ini = f.selectionStart; var _fin = f.selectionEnd; var inicio = f.value.substr(0, _ini); var fin = f.value.substr(_fin, f.value.length); f.value = inicio + x + fin; if (_ini == _fin){ f.selectionStart = inicio.length + x.length; f.selectionEnd = f.selectionStart; } else{ f.selectionStart = inicio.length; f.selectionEnd = inicio.length + x.length; } f.focus(); } function wordCount(limite,objeto, valor) { textoArea = document.getElementById(objeto).value; numeroCaracteres = textoArea.length; inicioBlanco = /^ / finBlanco = / $/ variosBlancos = /[ ]+/g textoArea = textoArea.replace(inicioBlanco,""); textoArea = textoArea.replace(finBlanco,""); textoArea = textoArea.replace(variosBlancos," "); textoAreaDividido = textoArea.split(" "); numeroPalabras = textoAreaDividido.length; document.getElementById("palabras").value = numeroPalabras; if(numeroPalabras < limite){ num_caracte= numeroCaracteres; }else{ //document.getElementById('respuesta_writing').value = document.getElementById('respuesta_writing').value.substring(0, num_caracte); } } function zoomText(Accion,Elemento){ //inicializacion de variables y parámetros var obj=document.getElementById(Elemento); var max = 200 //tamaño máximo del fontSize var min = 70 //tamaño mínimo del fontSize var cont = 1; var valor2 = 0; if (obj.style.fontSize==""){ obj.style.fontSize="100%"; } actual=parseInt(obj.style.fontSize); //valor actual del tamaño del texto incremento=10;// el valor del incremento o decremento en el tamaño actual2=parseInt($(".conte").height()); //accion sobre el texto if( Accion=="reestablecer" ){ obj.style.fontSize="100%"; } if(Accion=="aumentar" && ((actual+incremento) <= max )){ valor=actual+incremento; cont=actual2+1; obj.style.fontSize=valor+"%"; $('.opciones').css('font-size', valor+"%"); $('.preg').css('font-size', valor+"%"); $('.lectura').css('font-size', valor+"%"); $('.conte').css('height', cont+"px"); } if(Accion=="disminuir" && ((actual+incremento) >= min )){ valor=actual-incremento; cont=actual2-1; obj.style.fontSize=valor+"%"; $('.opciones').css('font-size', valor+"%"); $('.preg').css('font-size', valor+"%"); $('.lectura').css('font-size', valor+"%"); $('.conte').css('height', cont+"px"); } } function audio_ibt(){ var audio23 = document.getElementById("reproductor23"); var archivo_audio = document.getElementById("audio_writing").value; var carpeta = document.getElementById("carpeta24").value; var subcarpeta = document.getElementById("subcarpeta24").value; audio23.src = "http://toefl.pass-your.com/audio/ibt/"+carpeta+"/"+subcarpeta+"/"+archivo_audio+".ogg"; audio23.addEventListener('ended', function () { setTimeout(function () { document.getElementById('resp_writing').style.display='block'; }, 500); }, false); audio23.play(); } function ejecutes2(){ myCounter_section.stop(); myCounter_section_listening.stop(); $f(document.getElementById('player22')).addEvent('ready', ready22); } function corta_writing(){ $f(document.getElementById('player22')).api('pause'); document.getElementById('instrucion2').style.display='none'; document.getElementById('corta_writing').style.display='none'; detenerse(); document.getElementById('complemento').style.display='none'; //ocultamos el video document.getElementById('pre_instrucion2').style.display='block'; //mostramos nuevamente el texto document.getElementById('preg_lect_ibt').style.display='block'; audio_ibt(); //ejecutamos audio } function ready22(player_id) { var player22 = $f(player_id); player22.addEvent('finish', function(data){ document.getElementById('instrucion2').style.display='none'; document.getElementById('pre_instrucion2').style.display='block'; carga_reloj(); }); } function ready23(player_id) { var player23 = $f(player_id); player23.addEvent('finish', function(data){ document.getElementById('complemento').style.display='none'; //ocultamos el video document.getElementById('pre_instrucion2').style.display='block'; //mostramos nuevamente el texto document.getElementById('preg_lect_ibt').style.display='block'; audio_ibt(); //ejecutamos audio }); } var cronometro2; function detenerse(){ clearInterval(cronometro2); } function carga_reloj(){ document.getElementById('reloj_ibt').style.display='block'; contador_s =0; contador_m =0; s = document.getElementById("segundostt"); m = document.getElementById("minutostt"); tp = document.getElementById("tiempo_lectura").value; cronometro2 = setInterval( function(){ if(contador_s==60){ contador_s=0; contador_m++; m.innerHTML = contador_m; if(contador_m==tp){ alert('Your time is up'); detenerse(); document.getElementById('pre_instrucion2').style.display='none'; document.getElementById('complemento').style.display='block'; $f(document.getElementById('player23')).addEvent('ready', ready23); $f(document.getElementById('player23')).api('play'); } if(contador_m==60){ contador_m=0; } } s.innerHTML = contador_s; contador_s++; } ,1000); } function subir_tarea(urltarea){ document.getElementById('ventana_sube').style.display='block'; document.getElementById('frame_sube').src = urltarea; } function cerrar_tarea(){ document.getElementById('ventana_sube').style.display='none'; } function nosenene3(){ //grabando respuesta document.getElementById('pregunta').style.display='none'; document.getElementById('prepara_regunta').style.display='none'; document.getElementById('prepara_respuesta').style.display='block'; var tipograba = document.getElementById("tiempo_grabar").value; myCountergraba.start(tipograba); } function ejecutes(idPregunta){ $f(document.getElementById('player2')).addEvent('ready', ready2); } function ready2(player_id) { var player2 = $f(player_id); player2.addEvent('finish', function(data){ document.getElementById('prepara_regunta').style.display='block'; var tipoprepara = document.getElementById("tiempo_preparar").value; myCountervideo.start(tipoprepara); }); } function ready1(player_id) { var player1 = $f(player_id); player1.addEvent('finish', function(data){ document.getElementById('pre_instrucion').style.display='none'; document.getElementById('pregunta').style.display='block'; $f(document.getElementById('player2')).addEvent('ready', ready2); $f(document.getElementById('player2')).api('play'); }); } function ready(player_id) { var player = $f(player_id); player.addEvent('finish', function(data){ document.getElementById('instrucion').style.display='none'; document.getElementById('pre_instrucion').style.display='block'; $f(document.getElementById('player1')).addEvent('ready', ready1); $f(document.getElementById('player1')).api('play'); }); } function ejecuta1(){ $f(document.getElementById('player222')).addEvent('ready', ready244); } function ready244(player_id) { var player = $f(player_id); player.addEvent('finish', function(data){ seguiente_ibt(); }); } function marcar(id,iduser){ muestra('http://toefl.pass-your.com/include/marca.php','id='+id+'&user='+iduser+'','rep_marca'+id+'','post'); } //verificamos si las cookies estan activas. //https://support.google.com/accounts/answer/61416?hl=es-419 if(navigator.cookieEnabled == 0){ alert("Este sitio necesita tener habilitadas cookies, activalas en la configuración de tu navegador."); } // Verificación de tiempo de sesión, para poder renovar sesión o continuar idleTime = 0; $(document).ready(function () { //Increment the idle time counter every minute. var idleInterval = setInterval("timerIncrement()", 60000); // 1 minute, 60 segundos //Zero the idle timer on mouse movement. $(this).mousemove(function (e) { idleTime = 0; }); $(this).keypress(function (e) { idleTime = 0; }); $("#botmenu").click(function () { $('#navega').toggle(2000); $("#botmenu").hide(); $("#botmenu2").show(); }); $("#botmenu2").click(function () { $('#navega').toggle(2000); $("#botmenu").show(); $("#botmenu2").hide(); }); }) function mensajeExpira(message) { if(confirm(message)){ window.location.reload(); }else{ location.href = 'http://toefl.pass-your.com/?logout=1'; } } function timerIncrement() { idleTime = idleTime + 1; if (idleTime > 25) { // Los minutos mensajeExpira('La sesión expira pronto, clic en el botón aceptar para renovar sesión.'); } } var myCountergraba = new Countdown({ //prepara respuesta onUpdateStatus: function(sec){ console.log(sec); var tipograbaa = document.getElementById("tiempo_grabar").value; var cuanto= sec / tipograbaa * 100; document.getElementById('barraprogreso_pp2').style.width=''+cuanto+'%'; document.getElementById('barraprogreso_pp2').innerHTML = ""+sec+" segundos"; }, onCounterEnd: function(){ seguiente_ibt();} // final action }); var myCountervideo = new Countdown({ //prepara respuesta onUpdateStatus: function(sec){ console.log(sec); var tipopreparaa = document.getElementById("tiempo_preparar").value; var cuanto= sec / tipopreparaa * 100; document.getElementById('barraprogreso_pp').style.width=''+cuanto+'%'; document.getElementById('barraprogreso_pp').innerHTML = ""+sec+" segundos"; }, onCounterEnd: function(){ nosenene3(); } // final action }); var myCounter = new Countdown({ //contador de duración de las preguntas. //seconds:5, // number of seconds to count down onUpdateStatus: function(sec){ console.log(sec); var tiemposecc1 = document.getElementById("timepregunta").value; var porcentajesecc1= sec / tiemposecc1 * 100; document.getElementById('barraprogreso').style.width=''+porcentajesecc1+'%'; }, // callback for each second onCounterEnd: function(){document.getElementById('tiempo').style.display='';document.getElementById('op1').click();activa_sig('0x');} // final action }); var myCounter2 = new Countdown({ //contador de duración de las preguntas. //seconds:5, // number of seconds to count down onUpdateStatus: function(sec){ console.log(sec); var tiemposecc = document.getElementById("timepregunta").value; var porcentajesecc= sec / tiemposecc * 100; document.getElementById('barraprogreso').style.width=''+porcentajesecc+'%';}, // callback for each second onCounterEnd: function(){ document.getElementById('tiempo').style.display=''; document.getElementById('op1').click(); activa_sig('0x'); // final action var tipo_act = document.getElementById("tipo_act").value; var nump_act = document.getElementById("nump_act").value; var test_secc = document.getElementById("test_secc").value; muestra('http://toefl.pass-your.com//mod/alumno/responder_falta.php','test='+test_secc+'&tipo='+tipo_act+'&num_pregunta='+nump_act+'','result','post'); var preg_secc = document.getElementById("numpre_secc").value; var tipo_secc = document.getElementById("tipo_secc").value; var tema_secc = document.getElementById("tema_secc").value; alert("Tiempo agotado de la sección, te redireccionaremos a la siguiente sección."); muestra('http://toefl.pass-your.com//mod/alumno/alumno.php','test='+test_secc+'&tipo='+tipo_secc+'&tema='+tema_secc+'&preg='+preg_secc+'','result','post'); } }); var myCounter3 = new Countdown({ //contador de duración de las preguntas. onUpdateStatus: function(sec){console.log(sec);}, // callback for each second onCounterEnd: function(){ document.getElementById('tiempo').style.display=''; document.getElementById('op1').click(); activa_sig('0x'); // final action var tipo_act2 = document.getElementById("id_test_otro").value; var nump_act2 = document.getElementById("id_pregu_otro").value; muestra('http://toefl.pass-your.com//mod/alumno/responder_falta2.php','test='+tipo_act2+'&num_pregunta='+nump_act2+'','result','post'); alert("El tiempo se ha terminado, finalizamos esta sección."); muestra('http://toefl.pass-your.com//include/mensaje.php','m= Test Completado','result','post'); } }); /* var dragsort = ToolMan.dragsort() var junkdrawer = ToolMan.junkdrawer() window.onload = function() { junkdrawer.restoreListOrder("ordenar") dragsort.makeListSortable(document.getElementById("ordenar"), verticalOnly, saveOrder) } function verticalOnly(item) { item.toolManDragGroup.verticalOnly() } function saveOrder(item) { var group = item.toolManDragGroup var list = group.element.parentNode var id = list.getAttribute("id") if (id == null) return group.register('dragend', function() { ToolMan.cookies().set("list-" + id, junkdrawer.serializeList(list), 365) }) } */ function reproAudio(){ var tipopregunta = document.getElementById("tipopreguntax").value; if(tipopregunta==2){ //Aplica ek timer por Pregunta myCounter.stop(); //detenemos el timer de la anterior pregunta para iniciar un timer en la nueva pregunta var segundos = document.getElementById("timepregunta").value; //Tiempo de la pregunta var cualaudio = document.getElementById("cualaudio").value; //Audio que se reproducira var audio = document.getElementById("reproductor"); //Creamos Objeto del reproductor para manipularlo. audio.src = "http://toefl.pass-your.com/audio/audio/"+cualaudio+".ogg"; audio.addEventListener("canplaythrough", function () { document.getElementById("statusbug").value = "El audio se ha descargado, espere su reproducción."; }, false); audio.addEventListener('ended', function () { setTimeout(function () { myCounter.start(segundos); }, 500); //Al terminar el audio ejecutamos la funcion de tiempo }, false); audio.play(); // Play Audio document.getElementById('pad10').onmouseover = ""; //Borramos función en el div para que no se repita. :D #truco mike } } function reproAudioListening(){ var cualaudio = document.getElementById("cualaudio").value; //Audio que se reproducira var audio = document.getElementById("reproductor"); //Creamos Objeto del reproductor para manipularlo. audio.src = "http://toefl.pass-your.com/audio/audio/"+cualaudio+".ogg"; audio.addEventListener("canplaythrough", function () { document.getElementById("statusbug").value = "El audio se ha descargado, espere su reproducción."; }, false); audio.addEventListener('ended', function () { setTimeout(function () { }, 500); //Al terminar el audio ejecutamos la funcion de tiempo }, false); audio.play(); // Play Audio document.getElementById('pad10').onmouseover = ""; //Borramos función en el div para que no se repita. :D #truco mike } function reproAudioPrueba(cualaudio){ var audio = document.getElementById("reproductor"); audio.src = "http://toefl.pass-your.com/audio/audio/"+cualaudio+".ogg"; audio.play(); // Play Audio } var contador_s2 =59; var contador_m2 =59; var myCounter_section = new Countdown({ //contador de seccion de reading ibt onUpdateStatus: function(sec){ s = document.getElementById("segundostt"); m = document.getElementById("minutostt"); if(contador_s2==0){ contador_s2=59; contador_m2--; m.innerHTML = contador_m2; if(contador_m2==59){ contador_m2=0; } } if(contador_m2==59){ m.innerHTML = 59; } s.innerHTML = contador_s2; m.innerHTML = contador_m2; contador_s2--; console.log(sec); }, onCounterEnd: function(){} }); var contador_s3 =59; var contador_m3 =49; var myCounter_section_listening = new Countdown({ //contador de seccion de reading ibt onUpdateStatus: function(sec){ s = document.getElementById("segundostt"); m = document.getElementById("minutostt"); if(contador_s3==0){ contador_s3=59; contador_m3--; m.innerHTML = contador_m3; if(contador_m3==59){ contador_m3=0; } } if(contador_m3==49){ m.innerHTML = 49; } s.innerHTML = contador_s3; contador_s3--; console.log(sec); }, onCounterEnd: function(){} }); var cronometro3; function detenerse3(){ clearInterval(cronometro3); } function carga_reloj3(){ document.getElementById('reloj_ibt').style.display='block'; contador_s =0; contador_m =0; s = document.getElementById("segundostt"); m = document.getElementById("minutostt"); //tp = document.getElementById("tiempo_lectura").value; cronometro3 = setInterval( function(){ if(contador_s==60){ contador_s=0; contador_m++; m.innerHTML = contador_m; if(contador_m==tp){ alert('Your time is up'); detenerse(); } if(contador_m==60){ contador_m=0; } } s.innerHTML = contador_s; contador_s++; } ,1000); } function validar(esto){ var valido = false; for(a=0;a