Quiz con respuestas de opción múltiple...

  • discworldian
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Abr 06, 2003
  • Mensajes: 5
  • Status: Offline

Nota Abril 7th, 2003, 2:12 am

En mi página ( http://www.student.kun.nl/m.vanderheijden/whichwitch.html ) Me hizo una prueba con respuestas de opción múltiple, sólo me dieron la información que la prueba era demasiado fácil de analizar desde las opciones que conducen a la misma respuesta siempre están en el mismo orden. Parece que necesito 10 veces más código para obtener un orden aleatorio de respuestas. ¿Alguien sabe una forma más rápida?


MIR
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Abril 7th, 2003, 2:12 am

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • Avatar de Usuario
  • Registrado: Dic 20, 2002
  • Mensajes: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Online

Nota Abril 7th, 2003, 2:44 am

Así como ¿qué significa? son las respuestas correctas como la primera opción todo el tiempo para cada pregunta?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • discworldian
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Abr 06, 2003
  • Mensajes: 5
  • Status: Offline

Nota Abril 7th, 2003, 3:15 am

No, su más al igual que el concurso es de 3 caracteres de un libro, y el caracter que más se asemejan. a fin de primera respuesta es de carácter 1, segunda respuesta de carácter 2, tercera respuesta de carácter 3.

MIR
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • Avatar de Usuario
  • Registrado: Dic 20, 2002
  • Mensajes: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Online

Nota Abril 7th, 2003, 5:02 am

Ya veo bien la forma en que lo tienes ahora mismo en la fuente es como esta:

Código: [ Select ]
What's the best way to cure the flu?<br>
<input type="radio" name="q2">Give the patient a medicine made out of rare herbs, which you have researched for years<br>
<input type="radio" name="q2">Give the patient a bottle of scumble and tell him/her to stay in bed if they like<br>
<input type="radio" name="q2">Give the patient a bottle of coloured water, which you say is a very special medicine<br>
  1. What's the best way to cure the flu?<br>
  2. <input type="radio" name="q2">Give the patient a medicine made out of rare herbs, which you have researched for years<br>
  3. <input type="radio" name="q2">Give the patient a bottle of scumble and tell him/her to stay in bed if they like<br>
  4. <input type="radio" name="q2">Give the patient a bottle of coloured water, which you say is a very special medicine<br>


y la forma en que tenga su código javascript que simplemente determina por el orden en que sean objeto de determinar qué valor que reciben. Lo que quiero hacer es que cada una vale un valor y moverlos como a continuación:

Código: [ Select ]
What's the best way to cure the flu?<br>
<input type="radio" name="q2" value="2">Give the patient a bottle of scumble and tell him/her to stay in bed if they like<br>
<input type="radio" name="q2" value="3">Give the patient a bottle of coloured water, which you say is a very special medicine<br>
<input type="radio" name="q2" value="1">Give the patient a medicine made out of rare herbs, which you have researched for years<br>
  1. What's the best way to cure the flu?<br>
  2. <input type="radio" name="q2" value="2">Give the patient a bottle of scumble and tell him/her to stay in bed if they like<br>
  3. <input type="radio" name="q2" value="3">Give the patient a bottle of coloured water, which you say is a very special medicine<br>
  4. <input type="radio" name="q2" value="1">Give the patient a medicine made out of rare herbs, which you have researched for years<br>


Entonces tendrá que reescribir el código javascript que algunos simplemente determinar cuántos puntos para agregar valor al ver lo que la cuestión de la pena (en vez de basarlo en el orden en que se colocan). Espero que tenga sentido.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • discworldian
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Abr 06, 2003
  • Mensajes: 5
  • Status: Offline

Nota Abril 7th, 2003, 5:03 am

Gracias, Ill que intentar.


MIR
  • killercelery
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Jul 10, 2003
  • Mensajes: 13
  • Loc: Montréal, Québec
  • Status: Offline

Nota Julio 15th, 2003, 9:37 am

Una gran característica de HTML es la posibilidad de crear nuevos elementos para una etiqueta. Para su problema, simplemente me creó la bruja elemento en cada entrada de etiqueta. Todo lo que necesitas para cambiar en el código actual es las dos funciones y agregar el elemento de brujas en cada etiqueta de entrada como esta:

Código: [ Select ]
function update(q)
{    
    if(document.whichwitch.elements[q].checked){
        switch(document.whichwitch.elements[q].witch){
            case "Granny": gscore+=1;
                        break;
            case "Magrat": mscore+=1;
                        break;
            case "Nanny": nscore+=1;
                        break;
        }
    }
}

function rateWitch()
{    
    for(q=0; q<30; q++)
        update(q)
    if (gscore > nscore)
        if (gscore > mscore)
            document.whichwitch.rating.value="Granny"
        else     document.whichwitch.rating.value="Magrat"
    else if (nscore > mscore)
            document.whichwitch.rating.value="Nanny"
       else     document.whichwitch.rating.value="Magrat"
}

...

Do you believe in true love?<br>
input type="radio" name="q0" witch="Granny">Yes<br>
input type="radio" name="q0" witch="Magrat">Yes, but not just one love though<br>
input type="radio" name="q0" witch="Nanny">No<br>
...
  1. function update(q)
  2. {    
  3.     if(document.whichwitch.elements[q].checked){
  4.         switch(document.whichwitch.elements[q].witch){
  5.             case "Granny": gscore+=1;
  6.                         break;
  7.             case "Magrat": mscore+=1;
  8.                         break;
  9.             case "Nanny": nscore+=1;
  10.                         break;
  11.         }
  12.     }
  13. }
  14. function rateWitch()
  15. {    
  16.     for(q=0; q<30; q++)
  17.         update(q)
  18.     if (gscore > nscore)
  19.         if (gscore > mscore)
  20.             document.whichwitch.rating.value="Granny"
  21.         else     document.whichwitch.rating.value="Magrat"
  22.     else if (nscore > mscore)
  23.             document.whichwitch.rating.value="Nanny"
  24.        else     document.whichwitch.rating.value="Magrat"
  25. }
  26. ...
  27. Do you believe in true love?<br>
  28. input type="radio" name="q0" witch="Granny">Yes<br>
  29. input type="radio" name="q0" witch="Magrat">Yes, but not just one love though<br>
  30. input type="radio" name="q0" witch="Nanny">No<br>
  31. ...


simplemente asociar el nombre de las brujas con la respuesta correcta y, a continuación, puede mezclar el orden de las preguntas que desee.

Espero que esto ayude.

Publicar Información

  • Total de mensajes en este tema: 6 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 245 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC