I am assuming that you want the entire quiz to run from the browser (client-side javascript), and that you have selected e-mail as your best option to receive the results.
If you want to use a quiz to update a data base, then you will have to use server-side as well.
The downside of email is that once sent it cannot be updated by the sender, and that somebody's eyeballs usually have to wear out examining the crazy formatted input.
<input type="text" name="formName" size="40"></td>
</tr>
<tr>
<td bgcolor="#F5E8BC"><font color="#333399">What amount would you take as a worthwhile invoice?...</font><font color="#FF0000">*</font></td>
<td valign="middle" align="left">
</tr>
<tr>
<td bgcolor="#F5E8BC"><font color="#333399">What sort of items do you prefer to monitor?...</font><font color="#FF0000">*</font></td>
<td valign="middle" align="left">
</tr>
<tr>
<td bgcolor="#F5E8BC"><font color="#333399">What is the correct name for Skrudge Mikduk?...</font><font color="#FF0000">*</font></td>
<td valign="middle" align="left">
I found how to make my online quiz. My problem now is: when they submit the form , I want the answers sent out(without them seeing the answers)by email and then they would be forwarded to a page that would be given the answers.
ex: 8 correct answers, 2 wrong. and they could see on that page which answers that they got wrong...
Melstef, The best way is to write a self-scoring test where you compare their answers given to an answer key. To do this however you need a server-side technology such as PHP so that they cannot see the scoring code.
I found the script I was looking for... It adds up the correct answers and when I receive the email, it right how many correct answers the person has.
1- The only thing, I would like at the bottom of the page, to eliminate the function "your quiz score is". If a eliminate the input function, I don't receive the score.
2- Where should I put in the script the forward page when the quiz is done and sent?
Here is the script;
<html>
<body bgcolor="#FFFF00">
<center>
<br>
<DIV ALIGN="CENTER"><IMG SRC="file:///D|/mdtint/images/MODELTECH%20LOGO%20(720x173).gif" WIDTH="360" HEIGHT="87">
</DIV>
<H2 ALIGN="CENTER"><B><FONT FACE="Arial"><I>Knowledge test on fire and life
safety</I></FONT></B></H2>
</center>
<blockquote>
<center>
</center>
<center>
</center>
<P ALIGN="LEFT"><B>1. Have you seen a live demonstration
of the Hazard House fire hazard simulator (school or elsewhere) ?</B></P>
<BLOCKQUOTE>
<P ALIGN="LEFT"><B>YES : go to #2<BR>
</B><B>NO : go to Quiz</B></P>
</BLOCKQUOTE>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="12%"><B><FONT FACE="Arial">2. I am</FONT></B></TD>
<TD WIDTH="16%"><B></B> <INPUT NAME="Student" TYPE="checkbox" ID="Student" VALUE="Yes">
Student </TD>
<TD WIDTH="72%">School :
<INPUT NAME="School" TYPE="text" ID="School"> </TD>
</TR>
<TR>
<TD> </TD>
<TD> </TD>
<TD>Grade: <INPUT NAME="Grade" TYPE="text" ID="Grade"> </TD>
</TR>
</TABLE>
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD WIDTH="1%"> </TD>
<TD WIDTH="11%"> </TD>
<TD WIDTH="88%"><INPUT NAME="Parent / Educator" TYPE="checkbox" ID="Parent / Educator" VALUE="Yes">
Parent / Educator</TD>
</TR>
<TR>
<TD> </TD>
<TD> </TD>
<TD><INPUT NAME="Adult" TYPE="checkbox" ID="Adult" VALUE="Yes">
Adult </TD>
</TR>
</TABLE>
<P ALIGN="CENTER"><B><FONT SIZE="4">Quiz<BR>
A. Basic knowledge</FONT><BR>
(A must for kids up tp 5th grade)</B><br>
<br></P>
<B>A. What is the most common cause of kitchen fires?</B>
<ol>
<INPUT TYPE="radio" NAME="Q0" VALUE="Cooking with grease" onClick=Q0.value="A">
Cooking with grease<BR>
<INPUT TYPE="radio" NAME="Q0" value="Unattended cooking" onclick=Q0.value="B">
Unattended cooking<BR>
<INPUT TYPE="radio" NAME="Q0" value="Smoking" onclick=Q0.value="C">
Smoking<BR>
<INPUT TYPE="radio" NAME="Q0" value="Children playing with matches" onclick=Q0.value="D">
Children playing with matches<BR>
<INPUT TYPE="radio" NAME="Q0" value="* A & B" onclick=Q0.value="*">
A & B<BR>
<INPUT TYPE="radio" NAME="Q0" value="All of the above" onclick=Q0.value="F">
All of the above<BR>
</ol>
<B>A1.Gasoline is dangerous because the:</B>
<ol>
<INPUT TYPE="radio" NAME="Q1" value="* Liquid might explode" onclick=Q1.value="*">Liquid might explode<BR>
<INPUT TYPE="radio" NAME="Q1" value=" Vapours might ignite" onclick=Q1.value="B">Vapours might ignite<BR>
<INPUT TYPE="radio" NAME="Q1" VALUE= "Fumes are toxic"onclick=Q1.value="C">Fumes are toxic<BR>
<INPUT TYPE="radio" NAME="Q1" VALUE=" Liquid mixes with other liquids"onclick=Q1.value="D">Liquid mixes with other liquids<BR>
</ol>
<B>A2. The most common kitchen fires involve:</B>
<ol>
<INPUT TYPE="radio" NAME="Q2" value="Grease build-up in broiler" onclick=Q2.value="A">
Grease buil-up in broiler<br>
<INPUT TYPE="radio" NAME="Q2" value=" Pan on top of stove" onclick=Q2.value="B">
Pan on top of stove<br>
<INPUT TYPE="radio" NAME="Q2" value="Microwave ovens" onclick=Q2.value="C">
Microwave ovens<br>
<INPUT TYPE="radio" NAME="Q2" value="* Electrical appliances" onclick=Q2.value="*">
Electrical appliances<br>
</ol>
<B>A3. The most effectrive way to extinguish a grease fire in a pan is:</B>
<ol>
<INPUT TYPE="radio" NAME="Q3" value="Place lid directly down on the pan" onclick=Q3.value="A">Place lid directly down on the pan<br>
<INPUT TYPE="radio" NAME="Q3" value="Shake baking soda on the fire" onclick=Q3.value="B">Shake baking soda on the fire<br>
<INPUT TYPE="radio" NAME="Q3" value="Carry the pan to the sink faucet" onclick=Q3.value="C">Carry the pan to the sink faucet<br>
<INPUT TYPE="radio" NAME="Q3" value="* Slide a lid over the top of the pan" onclick=Q3.value="*">Slide a lid over the top of the pan<br>
</ol>
<B>A4. When cooking at a stove, it is more important that you wear: </b>
<ol>
<INPUT TYPE="radio" NAME="Q4" value="Clothes that fit loosely around arms and body" onclick=Q4.value="A">Clothes that fit loosely around arms and body<br>
<INPUT TYPE="radio" NAME="Q4" value="Clothes that are made from nylon fabric" onclick=Q4.value="B">Clothes that are made from nylon fabric<br>
<INPUT TYPE="radio" NAME="Q4" value="* Clothes that fit tightly around arms and body" onclick=Q4.value="*">Clothes that fit tightly around arms and body<br>
<INPUT TYPE="radio" NAME="Q4" value=" Clothes that are made from coton fabric" onclick=Q4.value="D">Clothes that are made from coton fabric<br>
</ol>
<B>A5. The most effective way to contain an oven fire is:</B>
<ol>
<INPUT TYPE="radio" NAME="Q5" value="Remove pan from the oven" onclick=Q5.value="A">Remove pan from the oven<br>
<INPUT TYPE="radio" NAME="Q5" value="Use a fire extinguisher" onclick=Q5.value="B">Use a fire extinguisher<br>
<INPUT TYPE="radio" NAME="Q5" value="* Close the oven door" onclick=Q5.value="*">Close the oven door<br>
<INPUT TYPE="radio" NAME="Q5" value="Shake baking soda in the oven" onclick=Q5.value="D">Shake baking soda in the oven<br>
</ol>
<B>A6. How many feet should an electric portable heater be placed away from furniture, drapes, or other material that might catch on fire?</B>
<ol>
<INPUT TYPE="radio" NAME="Q6" value="* Three feet" onclick=Q6.value="*">Three feet<br>
<B>Q7. Why should bedroom door be closed while sleeping?</B>
<ol>
<INPUT TYPE="radio" NAME="Q7" value="For a better sleep" onclick=Q7.value="A">For a better sleep<br>
<INPUT TYPE="radio" NAME="Q7" value="To make it tougher for burglars" onclick=Q7.value="B">To make it tougher for burglars<br>
<INPUT TYPE="radio" NAME="Q7" value="*To prevent smoke and fire to be drafted in, durming a fire" onclick=Q7.value="*">To prevent smoke and fire to be drafted in, durming a fire<br>
</ol>
<B>A8. What has to be done prior to opening a door during a fire or a smoke alarm?</B>
<ol>
<INPUT TYPE="radio" NAME="Q8" value="*Test door knob temperature with back of hand" onclick=Q8.value="*">Test door knob temperature with back of hand<br>
<INPUT TYPE="radio" NAME="Q8" value="Shout for help" onclick=Q8.value="C">Shout for help<br>
</ol>
<B>A9. What happens when a plug is overloaded?</B>
<ol>
<INPUT TYPE="radio" NAME="Q9" value="It diminished the current to the appliances" onclick=Q9.value="A">It diminished the current to the appliances<br>
<INPUT TYPE="radio" NAME="Q9" value="*It overcharges the wire that can set on fire" onclick=Q9.value="*">It overcharges the wire that can set on fire<br>
<INPUT TYPE="radio" NAME="Q9" value="It diminishes the appliances life span" onclick=Q9.value="C">It diminishes the appliances life span<br>
</ol>
<B>A10. If you spill a chemical on your skin, what is the first action you should take?</B>
<ol>
<INPUT TYPE="radio" NAME="Q10" value="*Remove all clothing and wash the area for at least 20 minutes, then seek medical attention" onclick=Q10.value="*">Remove all clothing and wash the area for at least 20 minutes, then seek medical attention<br>
<INPUT TYPE="radio" NAME="Q10" value="Look up the antidote" onclick=Q10.value="B">Look up the antidote<br>
<INPUT TYPE="radio" NAME="Q10" value="Got to the hospital immediately" onclick=Q10.value="C">Got to the hospital immediately<br>
</ol>
<B>A11. What is a safe temperature for a hot water heater to be set at in the home?</B>
<ol>
<P ALIGN="CENTER"><B><FONT SIZE="4">B. Advanced Knowledge</FONT></B><BR>
(Kids can ask teen or grown ups to help) </P>
<P><B>B1. If there is a fire in your house the <I>first</I> thing you should
do is?</B> </P>
<ol>
<INPUT TYPE="radio" NAME="Q13" value="Try to put out the fire" onclick=Q13.value="A">Try to put out the fire<br>
<INPUT TYPE="radio" NAME="Q13" value="Open all the windows" onclick=Q13.value="B">Open all the windows<br>
<INPUT TYPE="radio" NAME="Q13" value="*Get out and stay out" onclick=Q13.value="*">Get out and stay out<br>
<INPUT TYPE="radio" NAME="Q13" value="Call the Fire Department" onclick=Q13.value="D">Call the Fire Department<br>
</ol>
<B>B2. If you wake up in a room filled with smoke you should:</B>
<ol>
<INPUT TYPE="radio" NAME="Q14" value="*Crawl low under smoke" onclick=Q14.value="*">Crawl low under smoke<br>
<INPUT TYPE="radio" NAME="Q14" value="Go back to sleep" onclick=Q14.value="B">Go back to sleep<br>
<INPUT TYPE="radio" NAME="Q14" value="Stand up and run out of the room" onclick=Q14.value="C">Stand up and run out of the room<br>
</ol>
<B>B3. Your home fire escape plan should include:</B>
<ol>
<INPUT TYPE="radio" NAME="Q15" value="Two ways out of every room" onclick=Q15.value="A">Two ways out of every room<br>
<INPUT TYPE="radio" NAME="Q15" value="A meeting place outside" onclick=Q15.value="B">A meeting place outside<br>
<INPUT TYPE="radio" NAME="Q15" value="* Both A & B" onclick=Q15.value="*">Both A & B<br>
</ol>
<B>B4. What is the first treatment for a burn?</B>
<ol>
<INPUT TYPE="radio" NAME="Q16" value="Put butter on the burn wound" onclick=Q16.value="A">Put butter on the burn wound<br>
<INPUT TYPE="radio" NAME="Q16" value="Put ice on the burn" onclick=Q16.value="B">Put ice on the burn<br>
<INPUT TYPE="radio" NAME="Q16" value="* Run the burn under cool water" onclick=Q16.value="*">Run the burn under cool water<br>
</ol> <B>B5. You must install a smoke alarm:</B>
<ol>
<INPUT TYPE="radio" NAME="Q17" value="Over the stove" onclick=Q17.value="A">Over the stove<br>
<INPUT TYPE="radio" NAME="Q17" value="In each bedroom" onclick=Q17.value="B">In each bedroom<br>
<INPUT TYPE="radio" NAME="Q17" value="*On every level of your home" onclick=Q17.value="*">On every level of your home<br>
<INPUT TYPE="radio" NAME="Q17" value="All of the above" onclick=Q17.value="D">All of the above<br>
</ol>
<B>B6. How often should you test your smoke alarm battery?</B>
<ol>
<INPUT TYPE="radio" NAME="Q19" value="* Matches and lighters" onclick=Q19.value="*">Matches and lighters<br>
<INPUT TYPE="radio" NAME="Q19" value="Baseball balls and bats" onclick=Q19.value="C">Baseball balls and bats<br>
</ol>
<B>B8. An electrical cord becomes a fire hazard when it is?</B>
<ol>
<INPUT TYPE="radio" NAME="Q20" value="Placed along the wall" onclick=Q20.value="A">Placed along the wall<br>
<INPUT TYPE="radio" NAME="Q20" value="Laid on a rug" onclick=Q20.value="B">Laid on a rug<br>
<INPUT TYPE="radio" NAME="Q20" value="Laid on a wooden floor" onclick=Q20.value="C">Laid on a wooden floor<br>
<INPUT TYPE="radio" NAME="Q20" value="* Placed under a rug or a door" onclick=Q20.value="*">Placed under a rug or a door<br>
</ol>
<B>B9. What is the most probable result when using an hair dryer in a bath tub?</B>
<ol>
<INPUT TYPE="radio" NAME="Q21" value="A funny tikling in the stomack" onclick=Q21.value="A">A funny tikling in the stomack<br>
<INPUT TYPE="radio" NAME="Q21" value="* A shock leading to probable death" onclick=Q21.value="*">A shock leading to probable death<br>
<B>B10. Why should toys or objects not be left lying around in the hall way or the stair</B>
<ol>
<INPUT TYPE="radio" NAME="Q22" value="In order not to break the toy or object" onclick=Q22.value="A">In order not to break the toy or object<br>
<INPUT TYPE="radio" NAME="Q22" value="* To prevent the risk of trippling over them and falling down" onclick=Q22.value="*">To prevent the risk of trippling over them and falling down<br>
I am using this script and it works well apart from 1 huge problem (lol).
I was use melstef's post as an example.
If i choose 22, "To prevent the risk of trippling over them and falling down" and press "score" I get 1 out of 22 right.
If i then choose Question 21, "A funny tikling in the stomack" and press "score" I get 1 out of 22 right, if I then choose, "A painfull shock" and press score i get "0 out of 22 right"...
It's as if my selection for question 22 can't be seen by the javascript function, I have to repress over the already existing question 22 selection and press "score" to get "2 out of 22 right"...
actually to elaborate, if I am simply to choose 1 correct answer and then press "score" I get "1 out of 22 right" but if I tap the button perhaps another 10 times it changes to "0 out of 22 right".... why is this happening?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.