Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    quiz more then one awnser

    hello, got this script

    http://javascriptkit.com/script/cut180.shtml

    now i changed the questions into checkboxes , how do i make
    it work if i want more then one awnser ?

    correctchoices[1]='c' (and 'd' ????)

    thx

  • #2
    piz
    piz is offline
    Regular Coder
    Join Date
    Jul 2002
    Location
    Barcelona
    Posts
    246
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First of all you have to replace the option-buttons for check-boxes, to allow multiple answers.

    To check the answer i would create an array in an array.

    For example... imagine, the forst question with 4 options and the option 2 and 4 are correct.

    First, i create an Array with all Questions.

    answers[0] <- first question
    answers[1] <- second
    etc.

    So in answer[0], i would put another array containing the correct answers of the first question, in this case:

    answer[0][0] would contain "b" or 1 (a would be 0), and answer[0][1] contains "d" or 3.

    So you can check all the answers with an nice loop.

    Saludo
    piz

  • #3
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you for the repley.
    im a beginner with javascripting, damn its hard !


    here is what i got.

    Questions:

    <input type="checkbox" value="a" name="question1">a) is this a question ?? <br>
    <input type="checkbox" value="b" name="question1">b) is also this a question ?? <br>


    Configfile:

    correctchoices[1]='a'

    How do i change this so 2 awnsers instead of 1 can be correct ?
    i couldnt really understand what you ment.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I do not think that script supports multiple correct answers feature. If you are not proficient with javascript your best bet is to contact the script author and ask for modifications.
    If the script features and ease of quiz creation and installation are more important to you than it being free, let me know. I'm currently working on one (ETA 1 week).
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •