Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-04-2003, 01:33 PM   PM User | #1
bellowc
New to the CF scene

 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
bellowc is an unknown quantity at this point
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
bellowc is offline   Reply With Quote
Old 06-04-2003, 02:30 PM   PM User | #2
piz
Regular Coder

 
Join Date: Jul 2002
Location: Barcelona
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
piz is an unknown quantity at this point
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
piz is offline   Reply With Quote
Old 06-04-2003, 03:04 PM   PM User | #3
bellowc
New to the CF scene

 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
bellowc is an unknown quantity at this point
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.
bellowc is offline   Reply With Quote
Old 06-04-2003, 05:19 PM   PM User | #4
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
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"
Vladdy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:53 AM.


Advertisement
Log in to turn off these ads.