Espero que hayáis estudiado porque llega un nuevo examen para comprobar tus conocimientos en el mundo del surf. No es nada serio, simplemente una forma de pasar un rato entretenido./* This script and many more are available free online at The JavaScript Source :: http://javascript.internet.com Created by: James Crooke :: http://www.cj-design.com */ var questions = new Array(); var choices = new Array(); var answers = new Array(); var response = new Array(); // To add more questions, just follow the format below. questions[0] = "1) ¿Joel Tudor es regular o goofy?"; choices[0] = new Array(); choices[0][0] = "Regular."; choices[0][1] = "Goofy."; choices[0][2] = "Ninguna de las anteriores."; answers[0] = choices[0][1]; questions[1] = "2) ¿En qu  isla está la ola de 'Banzai Pipeline'?"; choices[1] = new Array(); choices[1][0] = "Hawai."; choices[1][1] = "Kawai."; choices[1][2] = "Oahu."; choices[1][3] = "Molokai."; choices[1][4] = "Maui."; choices[1][5] = "Ninguna de las anteriores."; answers[1] = choices[1][2]; questions[2] = "3) ¿Quién fue la primera persona en conseguir 20 puntos en una manga de la ASP bajo el sistema de 'las dos mejores olas cuentan'?"; choices[2] = new Array(); choices[2][0] = "<a href="https://www.surf30.net/search/label/Tom Curren" target="_blank" title="Tom Curren">Tom Curren</a>."; choices[2][1] = "Tom Carrol."; choices[2][2] = "<a href="https://www.surf30.net/search/label/Joel Parkinson" target="_blank" title="Joel Parkinson">Joel Parkinson</a>."; choices[2][3] = "<a href="https://www.surf30.net/search/label/Kelly Slater" target="_blank" title="Kelly Slater">Kelly Slater</a>."; choices[2][4] = "Aaron ¨Robertson."; answers[2] = choices[2][3]; questions[3] = "4) ¿Qué surfista quedósegundo en el <a href="https://www.surf30.net/search/label/Billabong Pro Mundaka" target="_blank" title="Billabong Pro Mundaka">Billabong Pro Mundaka</a> del 2004 "; choices[3] = new Array(); choices[3][0] = "Luke Egan."; choices[3][1] = "Phil MacDonald ."; choices[3][2] = "Peterson Rosa"; choices[3][3] = "<a href="https://www.surf30.net/search/label/Tom Whitaker" target="_blank" title="Tom Whitaker">Tom Whitaker</a> ."; choices[3][4] = "Ninguno de los anteriores."; choices[3][5] = "Todos."; answers[3] = choices[3][1]; questions[4] = "5) Todos sabemos que existen las mareas lunares, pero, ¿Existen las mareas solares?"; choices[4] = new Array(); choices[4][0] = "Si."; choices[4][1] = "No."; answers[4] = choices[4][0]; questions[5] = "6) ¿Cuál de estas playas no está en Cantabria?"; choices[5] = new Array(); choices[5][0] = "Islares."; choices[5][1] = "Somo."; choices[5][2] = "Liencres."; choices[5][3] = "Malpica."; choices[5][4] = "Oyambre."; choices[5][5] = "Tagle."; choices[5][6] = "Todas estan en Cantabria."; answers[5] = choices[5][3]; // response for getting 100% response[0] = "¡Excelente, eres una máquina!"; // response for getting 90% or more response[1] = "Muy bien, intentalo otra vez para conseguir el 100%" // response for getting 70% or more response[2] = "¡Bien hecho!, notable!, ¿lo puedes hacer mejor?"; // response for getting over 50% response[3] = "Aprobado, has respondido más de la mitad de las preguntas correctamente."; // response for getting 40% or more response[4] = "Suspenso, te ha faltado poco para aprobar"; // response for getting 20% or more response[5] = "¡Mal, lo has hecho mal! "; // response for getting 10% or more response[6] = "Muy triste, me da que es imposible que pases el test por muchas veces que lo intentes"; // response for getting 9% or less response[7] = "¡Vete a casa ya! Un mono ciego lo haría mejor que tu."; /* This script and many more are available free online at The JavaScript Source :: http://javascript.internet.com Created by: James Crooke :: http://www.cj-design.com */ var useranswers = new Array(); var answered = 0; function renderQuiz() { for(i=0;i<questions.length;i++) { document.writeln('<br/><br/><b>' + questions[i] + '<span id="result_' + i + '"><img style="max-width: 100%;border: 0;"src="http://img13.imageshack.us/img13/8100/blankw.gif" style="border:0" alt="" />'); for(j=0;j<choices[i].length;j++) { document.writeln('<br/><input type="radio" name="answer_' + i + '" value="' + choices[i][j] + '" id="answer_' + i + '_' + j + '" class="question_' + i + '" onclick="submitAnswer(' + i + ', this, \'question_' + i + '\', \'label_' + i + '_' + j + '\')" /><label id="label_' + i + '_' + j + '" for="answer_' + i + '_' + j + '"> ' + choices[i][j] + ''); } } document.writeln('<br/><p><input type="submit" value="Ver la puntuación" onclick="showScore()" />   <input type="submit" value="Borrar el Test" onclick="resetQuiz(true)" /><p style="display:none"><img style="max-width: 100%;border: 0;"src="http://img12.imageshack.us/img12/8608/correct.gif" style="border:0" alt="¡Correcto!" /><img style="max-width: 100%;border: 0;"src="http://img11.imageshack.us/img11/5629/incorrect.gif" style="border:0" alt="¡Incorrecto!" />'); } function resetQuiz(showConfirm) { if(showConfirm) if(!confirm("Estas seguro de borrar las respuestas del test?")) return false; document.location = document.location; } function submitAnswer(questionId, obj, classId, labelId) { useranswers[questionId] = obj.value; document.getElementById(labelId).style.fontWeight = "bold"; disableQuestion(classId); showResult(questionId); answered++; } function showResult(questionId) { if(answers[questionId] == useranswers[questionId]) { document.getElementById('result_' + questionId).innerHTML = '<img style="max-width: 100%;border: 0;"src="http://img12.imageshack.us/img12/8608/correct.gif" style="border:0" alt="¡Correcto!" />'; } else { document.getElementById('result_' + questionId).innerHTML = '<img style="max-width: 100%;border: 0;"src="http://img11.imageshack.us/img11/5629/incorrect.gif" style="border:0" alt="¡Incorrecto!" />' + '<b>La respuesta correcta es: ' + answers[questionId] + ''; } } function showScore() { if(answered != answers.length) { alert("Todavia no has respondido a todas las preguntas"); return false; } questionCount = answers.length; correct = 0; incorrect = 0; for(i=0;i<questionCount;i++) { if(useranswers[i] == answers[i]) correct++; else incorrect++; } pc = Math.round((correct / questionCount) * 100); alertMsg = "Has contestado bien " + correct + " preguntas de " + questionCount + "\n\n"; alertMsg += "Has contestado correctamente al " + pc + "% de las preguntas! \n\n"; if(pc == 100) alertMsg += response[0]; else if(pc >= 90) alertMsg += response[1]; else if(pc >= 70) alertMsg += response[2]; else if(pc >= 50) alertMsg += response[3]; else if(pc >= 40) alertMsg += response[4]; else if(pc >= 20) alertMsg += response[5]; else if(pc >= 10) alertMsg += response[6]; else alertMsg += response[7]; if(pc < 100) { if(confirm(alertMsg)) resetQuiz(false); else return false; } else { alert(alertMsg); } } function disableQuestion(classId) { var alltags=document.all? document.all : document.getElementsByTagName("*") for (i=0; i<alltags.length; i++) { if (alltags[i].className == classId) { alltags[i].disabled = true; } } } renderQuiz();
No hay comentarios:
Anímate a participar en Surf 30, pero siempre con respeto.
Los comentarios reflejan solo las opiniones de los lectores.
Puedes consultar aquí la política de comenarios.