Después del éxito del primer Test de la semana, aquí va el segundo, este bastante más complicado. Va para nota.Después del éxito del primer Test de la semana, aquí va el segundo, este bastante más complicado. Va para nota.Comenzar body { min-height: 100vh;background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%); font-family: 'Roboto Condensed';} .container {margin: 150px auto 30px auto; max-width: 640px;} h1 { text-align: center; } #quiz-controls,#quiz-header,#quiz-results-screen,#quiz-start-screen{text-align:center}#quiz-results,.question{font-size:1.25em}.quiz-container{padding:1em;max-width:100%;margin:1em auto}.quiz-container a{text-decoration:none;color:#4db2ec}.answers{list-style:none;padding:0;!important;}.answers a{display:block;padding:.5em 1em;margin-bottom:.5em;background:#fff;border-radius:10px}.answers a.correct{background:#090}.answers a.incorrect{background:#c00}#quiz-buttons a,#quiz-controls,.quiz-container .quiz-button{padding:.5em 1em;background:#4db2ec;color:#fff;border-radius:10px}.answers a.correct,.answers a.incorrect{color:#fff}#quiz-buttons a,.quiz-container .quiz-button{display:inline-block}#quiz-buttons a{background:#fff;color:#4db2ec}.quiz-results-state #quiz-controls{background:0 0;padding:0}.quiz-results-state #quiz-buttons a{background:#4db2ec;color:#fff} #quiz-counter{text-align:right}/*! * jquery-quiz v0.0.1 - A simple jQuery quiz plugin. * Copyright (c) 2018 JC Hamill - http://jchamill.github.com/jquery-quiz/ * License: MIT */! function(a, b, c, d) { "use strict"; a.quiz = function(b, d) { var e = this; e.$el = a(b), e.$el.data("quiz", e), e.options = a.extend(a.quiz.defaultOptions, d); var f = e.options.questions, g = f.length, h = e.options.startScreen, i = e.options.startButton, j = e.options.homeButton, k = e.options.resultsScreen, l = e.options.gameOverScreen, m = e.options.nextButtonText, n = e.options.finishButtonText, o = e.options.restartButtonText, p = 1, q = 0, r = !1; e.methods = { init: function() { e.methods.setup(), a(c).on("click", i, function(a) { a.preventDefault(), e.methods.start() }), a(c).on("click", j, function(a) { a.preventDefault(), e.methods.home() }), a(c).on("click", ".answers a", function(a) { a.preventDefault(), e.methods.answerQuestion(this) }), a(c).on("click", "#quiz-next-btn", function(a) { a.preventDefault(), e.methods.nextQuestion() }), a(c).on("click", "#quiz-finish-btn", function(a) { a.preventDefault(), e.methods.finish() }), a(c).on("click", "#quiz-restart-btn, #quiz-retry-btn", function(a) { a.preventDefault(), e.methods.restart() }) }, setup: function() { var b = ""; e.options.counter && (b += '<div id="quiz-counter">'), b += '<div id="questions">', a.each(f, function(c, d) { b += '<div class="question-container">', b += '<p class="question">' + d.q + "", b += '<ul class="answers">', a.each(d.options, function(a, c) { b += 'Comenzar" }), b += "", b += "" }), b += "", 0 === a(k).length && (b += '<div id="' + k.substr(1) + '">', b += '<p id="quiz-results">', b += ""), b += '<div id="quiz-controls">', b += '<p id="quiz-response">', b += '<div id="quiz-buttons">', b += 'Comenzar", b += 'Comenzar", b += 'Comenzar", b += "", b += "", e.$el.append(b).addClass("quiz-container quiz-start-state"), a("#quiz-counter").hide(), a(".question-container").hide(), a(l).hide(), a(k).hide(), a("#quiz-controls").hide() }, start: function() { e.$el.removeClass("quiz-start-state").addClass("quiz-questions-state"), a(h).hide(), a("#quiz-controls").hide(), a("#quiz-finish-btn").hide(), a("#quiz-restart-btn").hide(), a("#questions").show(), a("#quiz-counter").show(), a(".question-container:first-child").show().addClass("active-question"), e.methods.updateCounter() }, answerQuestion: function(b) { if (!r) { r = !0; var c = a(b), d = "", g = c.data("index"), h = p - 1, i = f[h].correctIndex; if (g === i) c.addClass("correct"), d = f[h].correctResponse, q++; else if (c.addClass("incorrect"), d = f[h].incorrectResponse, !e.options.allowIncorrect) return void e.methods.gameOver(d); a("#quiz-response").html(d), a("#quiz-controls").fadeIn(), "function" == typeof e.options.answerCallback && e.options.answerCallback(p, g, f[h]) } }, nextQuestion: function() { r = !1, a(".active-question").hide().removeClass("active-question").next(".question-container").show().addClass("active-question"), a("#quiz-controls").hide(), ++p === g && (a("#quiz-next-btn").hide(), a("#quiz-finish-btn").show()), e.methods.updateCounter(), "function" == typeof e.options.nextCallback && e.options.nextCallback() }, gameOver: function(b) { if (0 === a(l).length) { var c = ""; c += '<div id="' + l.substr(1) + '">', c += '<p id="quiz-gameover-response">', c += '<p>Comenzar", c += "", e.$el.append(c) } a("#quiz-gameover-response").html(b), a("#quiz-counter").hide(), a("#questions").hide(), a("#quiz-finish-btn").hide(), a(l).show() }, finish: function() { e.$el.removeClass("quiz-questions-state").addClass("quiz-results-state"), a(".active-question").hide().removeClass("active-question"), a("#quiz-counter").hide(), a("#quiz-response").hide(), a("#quiz-finish-btn").hide(), a("#quiz-next-btn").hide(), a("#quiz-restart-btn").show(), a(k).show(); var nivel = ""; if (q == 10) nivel = "Nivel <a href="https://www.surf30.net/search/label/Kelly Slater" target="_blank" title="Kelly Slater">Kelly Slater</a>. Excelente, eres una maquina!"; if (q == 9) nivel = "Muy bien, intentalo otra vez para consequir el 100%"; if (q == 8) nivel = "Bien hecho, notable, lo puedes hacer mejor!"; if (q == 7) nivel = "Bien hecho, notable, lo puedes hacer mejor!"; if (q == 6) nivel = "Bien hecho, notable, lo puedes hacer mejor!"; if (q == 5) nivel = "Aprobado, has respondido mas de la mitad de las prequntas correctamente"; if (q == 4) nivel = "Suspenso, estas flojo"; if (q == 3) nivel = "Solo tres de 10? venqa ya"; if (q == 2) nivel = "Mal, un desastre. Asi no vas a aprobar el curso"; if (q == 1) nivel = "Muy triste, y la que has acertado ha sido de chiripa.!"; if (q == 0) nivel = "Vete a casa ya! Un mono ciego lo haria mejor que tu"; var b = e.options.resultsFormat.replace("%score", q).replace("%total", g).replace("%nivel", '' + nivel); a("#quiz-results").html(b), "function" == typeof e.options.finishCallback && e.options.finishCallback() }, restart: function() { e.methods.reset(), e.$el.addClass("quiz-questions-state"), a("#questions").show(), a("#quiz-counter").show(), a(".question-container:first-child").show().addClass("active-question"), e.methods.updateCounter() }, reset: function() { r = !1, p = 1, q = 0, a(".answers a").removeClass("correct incorrect"), e.$el.removeClass().addClass("quiz-container"), a("#quiz-restart-btn").hide(), a(l).hide(), a(k).hide(), a("#quiz-controls").hide(), a("#quiz-response").show(), a("#quiz-next-btn").show(), a("#quiz-counter").hide(), a(".active-question").hide().removeClass("active-question") }, home: function() { e.methods.reset(), e.$el.addClass("quiz-start-state"), a(h).show(), "function" == typeof e.options.homeCallback && e.options.homeCallback() }, updateCounter: function() { var b = e.options.counterFormat.replace("%current", p).replace("%total", g); a("#quiz-counter").html(b) } }, e.methods.init() }, a.quiz.defaultOptions = { allowIncorrect: !0, counter: !0, counterFormat: "%current/%total", startScreen: "#quiz-start-screen", startButton: "#quiz-start-btn", homeButton: "#quiz-home-btn", resultsScreen: "#quiz-results-screen", resultsFormat: "¡Has respondido correctamente a %score preguntas de %total %nivel", gameOverScreen: "#quiz-gameover-screen", nextButtonText: "Siguiente", finishButtonText: "Acabar", restartButtonText: "Volver a realizar el test" }, a.fn.quiz = function(b) { return this.each(function() { new a.quiz(this, b) }) }}(jQuery, window, document); $('#quiz').quiz({ //resultsScreen: '#results-screen', //counter: false, //homeButton: '#custom-home', counterFormat: 'Pregunta %current de %total', questions: [ { 'q': '¿Qué surfista ha competido en el circuito de longboard, en el CT, y en pruebas del Big Wave Toru?', 'options': [ 'Justine Dupont', 'Nat Young', 'Kelly Slater', '<a href="https://www.surf30.net/search/label/Aritz Aranburu" target="_blank" title="Aritz Aranburu">Aritz Aranburu</a>', 'Patrick DelPelo' ], 'correctIndex': 0, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: Justine Dupont.' }, { 'q': '¿Cuál era el nombre de Kelly Slater en los Vigilantes de la playa?', 'options': [ 'Leroy Johnson', 'Bruno Martelli', 'Danny Amatulo', 'Dylan Wright', 'Rick Kane', 'Jimmy Slade' ], 'correctIndex': 5, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: Jimmy Slade.' }, { 'q': '¿Qué ola situada en Anglet ahora extinta, fue surfeada por Kelly Slater en "Kelly Slater in Black and White"?', 'options': [ 'La Piste', 'La Barre', 'Le Baguete', 'Le Mares' ], 'correctIndex': 1, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: La Barre.' }, { 'q': '<a href="https://www.surf30.net/search/label/Mark Occhilupo" target="_blank" title="Mark Occhilupo">Mark Occhilupo</a> ganó en 1999 el campeonato del mundo de surf', 'options': [ 'Verdadero', 'Falso' ], 'correctIndex': 0, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: Verdadero.' }, { 'q': '¿En qué ola Mark Foo perdió la vida?', 'options': [ 'Pipeline', 'Waimea Bay', 'Mavericks' ], 'correctIndex': 2, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: Mavericks.' }, { 'q': '¿Qué surfista en la historia del WCT tiene el record de derrotas en una sola temporada?', 'options': [ 'Tom Tracy', '<a href="https://www.surf30.net/search/label/Ricky Basnett" target="_blank" title="Ricky Basnett">Ricky Basnett</a>', 'Aritz Aranburu', 'Andre Scopetta', 'Caleb Johnston' ], 'correctIndex': 1, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: Ricky Basnett' }, { 'q': 'Las Olas de transpolación:', 'options': [ 'Se presentan en la playa, la ola al tocar fondo avanza y se estrella en el litoral formando espuma.', 'Se producen por el viento y en ocasiones pueden ser altas como consecuencia de los huracanes.', 'Se representan en toda la superficie del mar y se deben a las variaciones del nivel del mar', 'Todas las anteriores', 'No existen' ], 'correctIndex': 4, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: No existen.' }, { 'q': '¿Cuál es la altura aproximada en metros de una ola que mida 7 pies?', 'options': [ '3 metros y medio', 'Un metro', 'Dos metros', 'Cuatro metros y medio' ], 'correctIndex': 2, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: Dos metros.' }, { 'q': '¿Cuantas veces <a href="https://www.surf30.net/search/label/Sunny Garcia" target="_blank" title="Sunny Garcia">Sunny Garcia</a> ha ganado el Triple Crown of Surfing?', 'options': [ '10', '6', '2', '5' ], 'correctIndex': 1, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: 6.' }, { 'q': '¿En qué país se encuentra la ola de "Boilers"?', 'options': [ 'Namibia', 'Australia', 'Estados Unidos', 'Marruecos', 'Perú' ], 'correctIndex': 3, 'correctResponse': '¡Correcto!', 'incorrectResponse': 'Error, la respuesta correcta es: Marruecos.' } ] });
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.