View Full Version : quiz script
petersruby
01-22-2003, 02:45 PM
Hello, I've searched unsuccessfully for a script that could help me achieve this. I'm wondering if anyone can give me advice on where to find a script for an online quiz. The quiz is intended to calculate a person's score based on the answers they choose. There are seven sections with about 10 yes or no questions in each section. If they answer yes, the get so many points. At the end of the quiz, it calculates their score and gives one of three summaries (Think Cosmo mag type quiz). I'm imagining a check box next to each question. If the check box is checked, the points get calculated. And the script would need to calculate at the end of the quiz, and return the correct summary. In other words, if the user gets 300 points, they get a particular message.
Any suggestions would be great.
Thanks.
beetle
01-22-2003, 04:07 PM
Javascript won't be the best tool for this. However, I did fing this (http://www.javascriptkit.com/script/cut180.shtml)
If you have PHP available to you, maybe there's something in here (http://www.hotscripts.com/PHP/Scripts_and_Programs/Tests_and_Quizzes/) that you can use....
whammy
01-23-2003, 12:59 AM
I see two possible scenarios:
1. You don't care about tallying results, or knowing what different users have entered - you just want to score them on their answers.
2. You want to tally the results and compare them with what other users have entered, etc.
• If your script matches the former description (you don't care about storing/comparing results), then that should be rather easy to write, if one knew the questions/answers/scoring criteria. In that case all you'd need to do would be to elaborate on your quiz (regarding the criteria I mentioned).
• If the latter is the case, you should not only elaborate on your quiz, but also decide what server-side language you wish to use - becuase javascript just can't do that. ;)
petersruby
01-23-2003, 12:27 PM
Thank you for the suggestions. I really appreciate it. I need people to take a quiz which measures how thrilling their life is. (This is actually something my boss needs me to do.) Since I posted the first time, I actually have implemented a perl script that does this (except for the emailing part). And my boss is pretty satisfied with it. However, I was looking for that "kick" that would have people oohing and aaahing.
There are 90 questions. Most questions have only two answers -- Yes or No. (However, some have as many as 5) If they answer yes, they get so many points. Depending on which questions they answer, they can get 1, 5, 10, 20, 50 or 100 points. For example, "Have you ever gone rock climbing?" Yes-10 points, No-0 points." Or even, "For every TV in your house, deduct 1 point." If you play video games, "deduct 10 points." Sometimes the question is "Have you ever won an award"? and the results are "No. And Yes, in high school; Yes, in college; and yes, professionally." So for this question they could possibly say yes to three things, each having a different point value. (that's why i was thinking check boxes, in case the users needs to check more than one). In the end, if the user gets 0-100 points, they get message1; 101-200 points, they get message2; 201-300, message 3; and over 300 message4. And no, I don't need the results stored or anything. However, if the users scores more than 300 points, I'd like the result to get emailed to me.
What the perl script does now, is give me radio buttons for yes and no. So the user can only answer one item. And for the "give yourself a point for every XXX you've done", I improvised and did ranges, like "if you've had 1-3 children, get 3 points; 4-6 children, 6 points..." But that actually doesn't give me an accurate total of points because a person who had 2 children, gets the same points and a person who had 3 children.
I'm sorry to go into so much detail. Like I said, I have one that works. I'm going to keep searching for something. If anybody here has advice, that'd be cool too.
Thanks a lot.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.