Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JAVASCRIPT QUIZ

Status
Not open for further replies.

techgrrl

Programmer
Joined
Jul 27, 2001
Messages
4
Location
US
Hello-
I'm reaching out once again for assistance. I have to develop an online multiple choice quiz (radio buttons), I would like the answers to go into an email in box when submitted, then---this is where I'm really stuck---I would like the user to be directed to a page with the answer that they submitted next to the correct answer and a brief explanation.

Any help greatly appreciated!
Thanks!
 
So lets say the user enters: "House" as answer and the correct is "ball", the you want the browser to be directed to a page where you can read something like this
Your answer was: House, the correct was: ball
Explanation: blaha blaha... etc


Did I get that part correct?

It can be done in JavaScript
just create arrays for it!
Code:
var qa1 = new Array();
qa1[0] = "ball";
qa1[1] = "dog";

var expl1 = new Array();
expl1[0] = "The ball is round"
expl1[1] = "A dog is an animal"
and upon submit
just do something like this...
Code:
display = window.open(...);
display.document.write( &quot;Your answer was:&quot; + answer + &quot;,the correct was:&quot; + q1[selected.radiobutton]+&quot;<br>Explanation:&quot;+expl1[selected.radiobutton] )
My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top