Foros del Web » Programando para Internet » Jquery »

Quiz con jQuery

Estas en el tema de Quiz con jQuery en el foro de Jquery en Foros del Web. Buenas tardes Estoy utilizando este Quiz: http://nazmulweb.com/Quiz HTML: @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código HTML: Ver original <!DOCTYPE html> < html lang = "en" >   < head ...
  #1 (permalink)  
Antiguo 26/07/2013, 12:02
Avatar de ceaped  
Fecha de Ingreso: febrero-2004
Mensajes: 2.185
Antigüedad: 20 años, 2 meses
Puntos: 9
Pregunta Quiz con jQuery

Buenas tardes
Estoy utilizando este Quiz:

http://nazmulweb.com/Quiz

HTML:
Código HTML:
Ver original
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.  
  6. <title>Titulo...</title>
  7.  
  8. <link href="css/jquiz.css" rel="stylesheet" />  
  9.  
  10. <script type="text/javascript" src="js/jquery.min.js"></script>
  11. <script type="text/javascript" src="js/jquiz.js" ></script>
  12.  
  13.  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  14.     <!--[if lt IE 9]>
  15.      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  16. <![endif]-->  
  17.  
  18. </head>
  19.  
  20.  
  21. <div id="container">
  22.        
  23. <div class="row">
  24.  
  25.        
  26. <ol id="jquiz">
  27.  
  28.         <li>
  29.         <p>Pregunta 1:</p>
  30.         <ul>
  31.        
  32.         <li class="correct"><h5>Opción 1</h5></li>
  33.         <li><h5>Opción 2</h5></li>
  34.         <li><h5>Opción 3</h5></li>
  35.         <li><h5>Opción 4</h5></li>
  36.         </ul>
  37.        
  38. <div class="explication oculto"><p>Explicación 1</p></div></li>
  39. <div class="explication oculto"><p>Explicación 2</p></div></li>
  40. <div class="explication oculto"><p>Explicación 3</p></div></li>
  41. <div class="explication oculto"><p>Explicación 4</p></div></li>
  42.  
  43. </ol>
  44. </div>
  45. </div>
  46.  
  47. </body>
  48. </html>

Código Javascript:
Ver original
  1. /*
  2. THIS CODE IS CREATED BY THE FOLKS AT WEBSITEDESIGNERNC.COM
  3. GO VISIT FOR ALL YOUR PROGRAMMING AND WEB DESIGN NEEDS!
  4. */
  5.  
  6. $(document).ready(function() {
  7.     var count = 0; 
  8.     var howmanyquestions = $("#jquiz > li").length;
  9.    
  10.     //the function for a clicked item
  11.     $("#jquiz li ul li").click(function(){
  12.    
  13.         if (!($(this).parent("ul").hasClass("answered"))) {
  14.        
  15.             // removes unanswered class and adds answered class so they cannot change answer
  16.             $(this).parent("ul").addClass("answered");
  17.            
  18.             // runs if they clicked the incorrect answer
  19.             if (!($(this).hasClass("correct"))) {
  20.                 // puts strike-through wrong answer and makes their answer red for incorrect
  21.                 $(this).addClass("wronganswer");
  22.                 $(this).siblings(".correct").addClass("realanswer");
  23.                 // animate explanation & add styling depending on answer
  24.                 $(this).parent().parent().children("div").prepend('<p>INCORRECTO</p>');
  25.                 $(this).parent().parent().children("div").addClass("wrongbox");
  26.                 $(this).parent().parent().children("div").fadeTo(500, 1).removeClass("hidden");
  27.             }
  28.            
  29.             // runs if they clicked the correct answer
  30.             if ($(this).hasClass("correct")) {
  31.                 //adds one to quiz total correct tally
  32.                 count++;
  33.                 // makes correct answer green
  34.                 $(this).addClass("correctanswer");
  35.                 // animate explanation & add styling depending on answer
  36.                 $(this).parent().parent().children("div").prepend('<p>CORRECTO</p>');
  37.                 $(this).parent().parent().children("div").addClass("rightbox");
  38.                 $(this).parent().parent().children("div").fadeTo(750, 1).removeClass("hidden");
  39.             }
  40.            
  41.             if ($('ul.answered').length == howmanyquestions) {
  42.                 $('#jquizremarks').fadeIn('slow');
  43.                 $('#jquiztotal').html('Tienes un '+count+' out of '+howmanyquestions+' en el quiz.');
  44.             }
  45.         }
  46.     });
  47. });

Yo que necesito que por cada opción me de una explicación distinta.

Opción 1...Explicación 1
Opción 2...Explicación 2
Opción 3...Explicación 3
Opción 4...Explicación 4

Gracias por su ayuda
__________________
Diseñador Gráfico publicitario
  #2 (permalink)  
Antiguo 29/07/2013, 18:50
Avatar de ceaped  
Fecha de Ingreso: febrero-2004
Mensajes: 2.185
Antigüedad: 20 años, 2 meses
Puntos: 9
Respuesta: Quiz con jQuery

Hola a todos
que pena por la insistencia pero no logro solucionar mi problema.
alguien me puede ayudar.

Gracias
__________________
Diseñador Gráfico publicitario

Etiquetas: quiz
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:37.