A
admin
Hi all,
First time poster here... I'm a webmaster and I'd like to add a simple
script to my website which will allow users to fill in a brief multiple
choice questionaire, and then provide a 'thoughful' suggestion based on
their answers.
In terms of the logic involved with the actual script: I've mulled it
over and thoroughly broken my brain, trying to devise a complicated
'scoring system' (with different answers giving different votes to
different outcomes) or an elimination system, with each answer
eliminating half of the possible outcomes, until there is only one
left. All of these inevitably elicit a "yeah, but what about this
case..."
I've finally decided that simpler is probably better... there are only
going to be a handful of questions, and I only have a handful of
outcomes, and I think I'd like to just provide my own answer, for each
unique combination of answers (there will be between 10-20 I think).
I'm struggling a bit with coding. I've looked at examples of
javascript quizzes, and mostly what I've found is stuff like this:
var score = 0;
ans[1] = "b";
ans[2] = "b";
ans[3] = "a";
ans[4] = "c";
ans[5] = "b";
accompanying this:
for(i=1;i<=5;i++){
answerText=answerText+"\nQuestion :"+i+"\n";
if(ans!=yourAns){
answerText=answerText+"\nThe correct answer was
"+ans+"\n"+explainAnswer+"\n";
}
else{
answerText=answerText+" \nCorrect! \n";
score++;
and:
answerText=answerText+"\n\nYour total score is : "+score+"\n";
I'm totally not up to speed with this stuff, but I'm eager to learn.
Deductively it looks like each question has a 'correct' answer in this
particular quiz and then it totals 'correct' answers. instead of this,
I want each possible string of answers to be a variable, at which point
the user is directed to an appropriate outcome page.
For example, AAAA = 1, AAAB = 2 AAAC = 3 and so on.
Does anyone have any scripts or any suggestions?
Thanks!
Chris
First time poster here... I'm a webmaster and I'd like to add a simple
script to my website which will allow users to fill in a brief multiple
choice questionaire, and then provide a 'thoughful' suggestion based on
their answers.
In terms of the logic involved with the actual script: I've mulled it
over and thoroughly broken my brain, trying to devise a complicated
'scoring system' (with different answers giving different votes to
different outcomes) or an elimination system, with each answer
eliminating half of the possible outcomes, until there is only one
left. All of these inevitably elicit a "yeah, but what about this
case..."
I've finally decided that simpler is probably better... there are only
going to be a handful of questions, and I only have a handful of
outcomes, and I think I'd like to just provide my own answer, for each
unique combination of answers (there will be between 10-20 I think).
I'm struggling a bit with coding. I've looked at examples of
javascript quizzes, and mostly what I've found is stuff like this:
var score = 0;
ans[1] = "b";
ans[2] = "b";
ans[3] = "a";
ans[4] = "c";
ans[5] = "b";
accompanying this:
for(i=1;i<=5;i++){
answerText=answerText+"\nQuestion :"+i+"\n";
if(ans!=yourAns){
answerText=answerText+"\nThe correct answer was
"+ans+"\n"+explainAnswer+"\n";
}
else{
answerText=answerText+" \nCorrect! \n";
score++;
and:
answerText=answerText+"\n\nYour total score is : "+score+"\n";
I'm totally not up to speed with this stuff, but I'm eager to learn.
Deductively it looks like each question has a 'correct' answer in this
particular quiz and then it totals 'correct' answers. instead of this,
I want each possible string of answers to be a variable, at which point
the user is directed to an appropriate outcome page.
For example, AAAA = 1, AAAB = 2 AAAC = 3 and so on.
Does anyone have any scripts or any suggestions?
Thanks!
Chris