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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An online QUIZ that the answers would be sent by email!!!

Status
Not open for further replies.

melstef

Programmer
Feb 19, 2003
69
CA
Hello, I'm having some problems. How do you make an online Quiz? Is it possible to send the answers by email?

My Quiz have 18 questions and 3 to 5 possible answers.

thanks for your help
 
Here is a start...

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.

<html>
<head>
<title>Quick Quiz</title>


</head>

<script language=javascript>

function gomail() {

var ssss = 'Name='+quizform.formName.value
+ '-----,q1a='+quizform.q1[0].checked+',q1b='+quizform.q1[1].checked+',q1c='+quizform.q1[2].checked+',q1d='+quizform.q1[3].checked
+ '-----,q2a='+quizform.q2[0].checked+',q2b='+quizform.q2[1].checked+',q2c='+quizform.q2[2].checked+',q2d='+quizform.q2[3].checked
+ '-----,q3='+quizform.q3.value
+ '-----end' ;

mailset(ssss);

}

function mailset(ansarea) {
towhom='yourpostaddress@somemail.com';
aboutwhat='quizanswers';
mailanswers=ansarea;
parent.location.href='mailto:'+towhom+'?subject='+aboutwhat+'&body='+mailanswers+' ';
}



</SCRIPT>



<body onload=&quot; document.quizform.q3.focus(); &quot;>

<form name=quizform>
<table>

<tr>

<td bgcolor=&quot;#c5E8BC&quot;><font color=&quot;#333399&quot;>Your Name:</font><font color=&quot;#FF0000&quot;>*</font></td>
<td valign=&quot;middle&quot; align=&quot;left&quot;>

<input type=&quot;text&quot; name=&quot;formName&quot; size=&quot;40&quot;></td>
</tr>
<tr>
<td bgcolor=&quot;#F5E8BC&quot;><font color=&quot;#333399&quot;>What amount would you take as a worthwhile invoice?...</font><font color=&quot;#FF0000&quot;>*</font></td>
<td valign=&quot;middle&quot; align=&quot;left&quot;>

<input name=q1 type=radio CHECKED >$100</input>
<input name=q1 type=radio>$500</input>
<input name=q1 type=radio>$1,000</input>
<input name=q1 type=radio>$10,000</input>


</tr>
<tr>
<td bgcolor=&quot;#F5E8BC&quot;><font color=&quot;#333399&quot;>What sort of items do you prefer to monitor?...</font><font color=&quot;#FF0000&quot;>*</font></td>
<td valign=&quot;middle&quot; align=&quot;left&quot;>

<input name=q2 type=checkbox CHECKED >Money</input>
<input name=q2 type=checkbox>Property</input>
<input name=q2 type=checkbox>People</input>
<input name=q2 type=checkbox>Artworks & Treasure</input>

</tr>
<tr>
<td bgcolor=&quot;#F5E8BC&quot;><font color=&quot;#333399&quot;>What is the correct name for Skrudge Mikduk?...</font><font color=&quot;#FF0000&quot;>*</font></td>
<td valign=&quot;middle&quot; align=&quot;left&quot;>

<input name=q3 type=text value=&quot;&quot;></input>

</tr></table>

<button onclick=&quot;gomail()&quot;>Submit</button>

</form>

 
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...

thanks for you help
 
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.

Clive
 
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 &quot;your quiz score is&quot;. 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>

<head>

<title>Online Quiz</title>

<script language=&quot;JavaScript&quot;>



<!--

function scorequiz(form) {

tally=0

if(form.Q0.value!=null && form.Q0.value==&quot;*&quot;) {tally=tally+1}

if(form.Q1.value!=null && form.Q1.value==&quot;*&quot;) {tally=tally+1}

if(form.Q2.value!=null && form.Q2.value==&quot;*&quot;) {tally=tally+1}

if(form.Q3.value!=null && form.Q3.value==&quot;*&quot;) {tally=tally+1}

if(form.Q4.value!=null && form.Q4.value==&quot;*&quot;) {tally=tally+1}

if(form.Q5.value!=null && form.Q5.value==&quot;*&quot;) {tally=tally+1}

if(form.Q6.value!=null && form.Q6.value==&quot;*&quot;) {tally=tally+1}

if(form.Q7.value!=null && form.Q7.value==&quot;*&quot;) {tally=tally+1}

if(form.Q8.value!=null && form.Q8.value==&quot;*&quot;) {tally=tally+1}

if(form.Q9.value!=null && form.Q9.value==&quot;*&quot;) {tally=tally+1}

if(form.Q10.value!=null && form.Q10.value==&quot;*&quot;) {tally=tally+1}

if(form.Q11.value!=null && form.Q11.value==&quot;*&quot;) {tally=tally+1}

if(form.Q12.value!=null && form.Q12.value==&quot;*&quot;) {tally=tally+1}

if(form.Q13.value!=null && form.Q13.value==&quot;*&quot;) {tally=tally+1}

if(form.Q14.value!=null && form.Q14.value==&quot;*&quot;) {tally=tally+1}

if(form.Q15.value!=null && form.Q15.value==&quot;*&quot;) {tally=tally+1}

if(form.Q16.value!=null && form.Q16.value==&quot;*&quot;) {tally=tally+1}

if(form.Q17.value!=null && form.Q17.value==&quot;*&quot;) {tally=tally+1}

if(form.Q18.value!=null && form.Q18.value==&quot;*&quot;) {tally=tally+1}

if(form.Q19.value!=null && form.Q19.value==&quot;*&quot;) {tally=tally+1}

if(form.Q20.value!=null && form.Q20.value==&quot;*&quot;) {tally=tally+1}

if(form.Q21.value!=null && form.Q21.value==&quot;*&quot;) {tally=tally+1}

if(form.Q22.value!=null && form.Q22.value==&quot;*&quot;) {tally=tally+1}

form.SCORE.value =eval(tally);

if (tally > 19)
{
alert (&quot;Excellent, you got &quot; + tally + &quot; out of 22&quot;);

}
else
if (tally > 11)
{
alert (&quot;Well done, you got &quot; + tally + &quot; out of 22&quot;);

}
else
if (tally < 11)
{
alert (&quot;You got &quot; + tally + &quot; out of 22, try again&quot;);

}


}

function clearquiz(form) {

tally=0

form.Q0.value=&quot;?&quot;

form.Q1.value=&quot;?&quot;

form.Q2.value=&quot;?&quot;

form.Q3.value=&quot;?&quot;

form.Q4.value=&quot;?&quot;

form.Q5.value=&quot;?&quot;

form.Q6.value=&quot;?&quot;

form.Q7.value=&quot;?&quot;

form.Q8.value=&quot;?&quot;

form.Q9.value=&quot;?&quot;

form.Q10.value=&quot;?&quot;

form.Q11.value=&quot;?&quot;

form.Q12.value=&quot;?&quot;

form.Q13.value=&quot;?&quot;

form.Q14.value=&quot;?&quot;

form.Q15.value=&quot;?&quot;

form.Q16.value=&quot;?&quot;

form.Q17.value=&quot;?&quot;

form.Q18.value=&quot;?&quot;

form.Q19.value=&quot;?&quot;

form.Q20.value=&quot;?&quot;

form.Q21.value=&quot;?&quot;

form.Q22.value=&quot;?&quot;


form.SCORE.value =eval(tally)

}




// -->



</script>
<STYLE TYPE=&quot;text/css&quot;>
<!--
BODY {background-image: url(images/fond-flammes); background-repeat: no-repeat}
-->
</STYLE>
</head>

<body bgcolor=&quot;#FFFF00&quot;>
<center>
<br>
<DIV ALIGN=&quot;CENTER&quot;><IMG SRC=&quot;file:///D|/mdtint/images/MODELTECH%20LOGO%20(720x173).gif&quot; WIDTH=&quot;360&quot; HEIGHT=&quot;87&quot;>
</DIV>
<H2 ALIGN=&quot;CENTER&quot;><B><FONT FACE=&quot;Arial&quot;><I>Knowledge test on fire and life
safety</I></FONT></B></H2>
</center>
<blockquote>
<center>
</center>

<Form name=&quot;quiz&quot; action =&quot;mailto:melstef2000@videotron.ca?subject=Quiz&quot; method=&quot;post&quot; enctype=&quot;text/plain&quot; onLoad=&quot;clearquiz(this.form)&quot; onsubmit=&quot;msg()&quot;>

<center>
</center>
<P ALIGN=&quot;LEFT&quot;><B>1. Have you seen a live demonstration
of the Hazard House fire hazard simulator (school or elsewhere) ?</B></P>
<BLOCKQUOTE>
<P ALIGN=&quot;LEFT&quot;><B>YES : go to #2<BR>
</B><B>NO   : go to Quiz</B></P>
</BLOCKQUOTE>
<TABLE WIDTH=&quot;100%&quot; BORDER=&quot;0&quot; CELLSPACING=&quot;0&quot; CELLPADDING=&quot;0&quot;>
<TR>
<TD WIDTH=&quot;12%&quot;><B><FONT FACE=&quot;Arial&quot;>2. I am</FONT></B></TD>
<TD WIDTH=&quot;16%&quot;><B></B> <INPUT NAME=&quot;Student&quot; TYPE=&quot;checkbox&quot; ID=&quot;Student&quot; VALUE=&quot;Yes&quot;>
Student  </TD>
<TD WIDTH=&quot;72%&quot;>School :
<INPUT NAME=&quot;School&quot; TYPE=&quot;text&quot; ID=&quot;School&quot;> </TD>
</TR>
<TR>
<TD> </TD>
<TD> </TD>
<TD>Grade:   <INPUT NAME=&quot;Grade&quot; TYPE=&quot;text&quot; ID=&quot;Grade&quot;> </TD>
</TR>
</TABLE>
<TABLE WIDTH=&quot;100%&quot; BORDER=&quot;0&quot; CELLSPACING=&quot;0&quot; CELLPADDING=&quot;0&quot;>
<TR>
<TD WIDTH=&quot;1%&quot;> </TD>
<TD WIDTH=&quot;11%&quot;> </TD>
<TD WIDTH=&quot;88%&quot;><INPUT NAME=&quot;Parent / Educator&quot; TYPE=&quot;checkbox&quot; ID=&quot;Parent / Educator&quot; VALUE=&quot;Yes&quot;>
Parent / Educator</TD>
</TR>
<TR>
<TD> </TD>
<TD>  </TD>
<TD><INPUT NAME=&quot;Adult&quot; TYPE=&quot;checkbox&quot; ID=&quot;Adult&quot; VALUE=&quot;Yes&quot;>
Adult </TD>
</TR>
</TABLE>
<P ALIGN=&quot;CENTER&quot;><B><FONT SIZE=&quot;4&quot;>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=&quot;radio&quot; NAME=&quot;Q0&quot; VALUE=&quot;Cooking with grease&quot; onClick=Q0.value=&quot;A&quot;>
Cooking with grease<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q0&quot; value=&quot;Unattended cooking&quot; onclick=Q0.value=&quot;B&quot;>
Unattended cooking<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q0&quot; value=&quot;Smoking&quot; onclick=Q0.value=&quot;C&quot;>
Smoking<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q0&quot; value=&quot;Children playing with matches&quot; onclick=Q0.value=&quot;D&quot;>
Children playing with matches<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q0&quot; value=&quot;* A & B&quot; onclick=Q0.value=&quot;*&quot;>
A & B<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q0&quot; value=&quot;All of the above&quot; onclick=Q0.value=&quot;F&quot;>
All of the above<BR>
</ol>

<B>A1.Gasoline is dangerous because the:</B>
<ol>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q1&quot; value=&quot;* Liquid might explode&quot; onclick=Q1.value=&quot;*&quot;>Liquid might explode<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q1&quot; value=&quot; Vapours might ignite&quot; onclick=Q1.value=&quot;B&quot;>Vapours might ignite<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q1&quot; VALUE= &quot;Fumes are toxic&quot;onclick=Q1.value=&quot;C&quot;>Fumes are toxic<BR>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q1&quot; VALUE=&quot; Liquid mixes with other liquids&quot;onclick=Q1.value=&quot;D&quot;>Liquid mixes with other liquids<BR>


</ol>
<B>A2. The most common kitchen fires involve:</B>
<ol>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q2&quot; value=&quot;Grease build-up in broiler&quot; onclick=Q2.value=&quot;A&quot;>
Grease buil-up in broiler<br>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q2&quot; value=&quot; Pan on top of stove&quot; onclick=Q2.value=&quot;B&quot;>
Pan on top of stove<br>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q2&quot; value=&quot;Microwave ovens&quot; onclick=Q2.value=&quot;C&quot;>
Microwave ovens<br>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q2&quot; value=&quot;* Electrical appliances&quot; onclick=Q2.value=&quot;*&quot;>
Electrical appliances<br>
</ol>



<B>A3. The most effectrive way to extinguish a grease fire in a pan is:</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q3&quot; value=&quot;Place lid directly down on the pan&quot; onclick=Q3.value=&quot;A&quot;>Place lid directly down on the pan<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q3&quot; value=&quot;Shake baking soda on the fire&quot; onclick=Q3.value=&quot;B&quot;>Shake baking soda on the fire<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q3&quot; value=&quot;Carry the pan to the sink faucet&quot; onclick=Q3.value=&quot;C&quot;>Carry the pan to the sink faucet<br>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q3&quot; value=&quot;* Slide a lid over the top of the pan&quot; onclick=Q3.value=&quot;*&quot;>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=&quot;radio&quot; NAME=&quot;Q4&quot; value=&quot;Clothes that fit loosely around arms and body&quot; onclick=Q4.value=&quot;A&quot;>Clothes that fit loosely around arms and body<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q4&quot; value=&quot;Clothes that are made from nylon fabric&quot; onclick=Q4.value=&quot;B&quot;>Clothes that are made from nylon fabric<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q4&quot; value=&quot;* Clothes that fit tightly around arms and body&quot; onclick=Q4.value=&quot;*&quot;>Clothes that fit tightly around arms and body<br>
<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q4&quot; value=&quot; Clothes that are made from coton fabric&quot; onclick=Q4.value=&quot;D&quot;>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=&quot;radio&quot; NAME=&quot;Q5&quot; value=&quot;Remove pan from the oven&quot; onclick=Q5.value=&quot;A&quot;>Remove pan from the oven<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q5&quot; value=&quot;Use a fire extinguisher&quot; onclick=Q5.value=&quot;B&quot;>Use a fire extinguisher<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q5&quot; value=&quot;* Close the oven door&quot; onclick=Q5.value=&quot;*&quot;>Close the oven door<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q5&quot; value=&quot;Shake baking soda in the oven&quot; onclick=Q5.value=&quot;D&quot;>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=&quot;radio&quot; NAME=&quot;Q6&quot; value=&quot;* Three feet&quot; onclick=Q6.value=&quot;*&quot;>Three feet<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q6&quot; value=&quot;two feet&quot; onclick=Q6.value=&quot;B&quot;>Two feet<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q6&quot; value=&quot;six feet&quot; onclick=Q6.value=&quot;C&quot;>Six feet<br>

</ol>





<B>Q7. Why should bedroom door be closed while sleeping?</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q7&quot; value=&quot;For a better sleep&quot; onclick=Q7.value=&quot;A&quot;>For a better sleep<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q7&quot; value=&quot;To make it tougher for burglars&quot; onclick=Q7.value=&quot;B&quot;>To make it tougher for burglars<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q7&quot; value=&quot;*To prevent smoke and fire to be drafted in, durming a fire&quot; onclick=Q7.value=&quot;*&quot;>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=&quot;radio&quot; NAME=&quot;Q8&quot; value=&quot;*Test door knob temperature with back of hand&quot; onclick=Q8.value=&quot;*&quot;>Test door knob temperature with back of hand<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q8&quot; value=&quot;Get dressed&quot; onclick=Q8.value=&quot;B&quot;>Get dressed<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q8&quot; value=&quot;Shout for help&quot; onclick=Q8.value=&quot;C&quot;>Shout for help<br>

</ol>




<B>A9. What happens when a plug is overloaded?</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q9&quot; value=&quot;It diminished the current to the appliances&quot; onclick=Q9.value=&quot;A&quot;>It diminished the current to the appliances<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q9&quot; value=&quot;*It overcharges the wire that can set on fire&quot; onclick=Q9.value=&quot;*&quot;>It overcharges the wire that can set on fire<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q9&quot; value=&quot;It diminishes the appliances life span&quot; onclick=Q9.value=&quot;C&quot;>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=&quot;radio&quot; NAME=&quot;Q10&quot; value=&quot;*Remove all clothing and wash the area for at least 20 minutes, then seek medical attention&quot; onclick=Q10.value=&quot;*&quot;>Remove all clothing and wash the area for at least 20 minutes, then seek medical attention<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q10&quot; value=&quot;Look up the antidote&quot; onclick=Q10.value=&quot;B&quot;>Look up the antidote<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q10&quot; value=&quot;Got to the hospital immediately&quot; onclick=Q10.value=&quot;C&quot;>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>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q11&quot; value=&quot;*130 degrees fahrenheit&quot; onclick=Q11.value=&quot;*&quot;>130 degrees fahrenheit<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q11&quot; value=&quot;120 degrees fahrenheit&quot; onclick=Q11.value=&quot;B&quot;>120 degrees fahrenheit<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q11&quot; value=&quot;150 degrees fahrenheit&quot; onclick=Q11.value=&quot;C&quot;>150 degrees fahrenheit<br>

</ol>

<B>A12. If a cigarette is dropped unnoticed between couch cushions, how long do you thing it can smolder before the couch catches fire?</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q12&quot; value=&quot;One hour&quot; onclick=Q12.value=&quot;A&quot;>One hour<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q12&quot; value=&quot;Two hours&quot; onclick=Q12.value=&quot;B&quot;>Twp hours<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q12&quot; value=&quot;Four hours&quot; onclick=Q12.value=&quot;C&quot;>Four hours<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q12&quot; value=&quot;* Thirty minutes&quot; onclick=Q12.value=&quot;*&quot;>Thirty minutes<br>

</ol>

<P ALIGN=&quot;CENTER&quot;><B><FONT SIZE=&quot;4&quot;>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=&quot;radio&quot; NAME=&quot;Q13&quot; value=&quot;Try to put out the fire&quot; onclick=Q13.value=&quot;A&quot;>Try to put out the fire<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q13&quot; value=&quot;Open all the windows&quot; onclick=Q13.value=&quot;B&quot;>Open all the windows<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q13&quot; value=&quot;*Get out and stay out&quot; onclick=Q13.value=&quot;*&quot;>Get out and stay out<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q13&quot; value=&quot;Call the Fire Department&quot; onclick=Q13.value=&quot;D&quot;>Call the Fire Department<br>

</ol>


<B>B2. If you wake up in a room filled with smoke you should:</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q14&quot; value=&quot;*Crawl low under smoke&quot; onclick=Q14.value=&quot;*&quot;>Crawl low under smoke<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q14&quot; value=&quot;Go back to sleep&quot; onclick=Q14.value=&quot;B&quot;>Go back to sleep<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q14&quot; value=&quot;Stand up and run out of the room&quot; onclick=Q14.value=&quot;C&quot;>Stand up and run out of the room<br>

</ol>
<B>B3. Your home fire escape plan should include:</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q15&quot; value=&quot;Two ways out of every room&quot; onclick=Q15.value=&quot;A&quot;>Two ways out of every room<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q15&quot; value=&quot;A meeting place outside&quot; onclick=Q15.value=&quot;B&quot;>A meeting place outside<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q15&quot; value=&quot;* Both A & B&quot; onclick=Q15.value=&quot;*&quot;>Both A & B<br>

</ol>



<B>B4. What is the first treatment for a burn?</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q16&quot; value=&quot;Put butter on the burn wound&quot; onclick=Q16.value=&quot;A&quot;>Put butter on the burn wound<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q16&quot; value=&quot;Put ice on the burn&quot; onclick=Q16.value=&quot;B&quot;>Put ice on the burn<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q16&quot; value=&quot;* Run the burn under cool water&quot; onclick=Q16.value=&quot;*&quot;>Run the burn under cool water<br>


</ol> <B>B5. You must install a smoke alarm:</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q17&quot; value=&quot;Over the stove&quot; onclick=Q17.value=&quot;A&quot;>Over the stove<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q17&quot; value=&quot;In each bedroom&quot; onclick=Q17.value=&quot;B&quot;>In each bedroom<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q17&quot; value=&quot;*On every level of your home&quot; onclick=Q17.value=&quot;*&quot;>On every level of your home<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q17&quot; value=&quot;All of the above&quot; onclick=Q17.value=&quot;D&quot;>All of the above<br>

</ol>
<B>B6. How often should you test your smoke alarm battery?</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q18&quot; value=&quot;Every month&quot; onclick=Q18.value=&quot;A&quot;>Every month<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q18&quot; value=&quot;* Every six months&quot; onclick=Q18.value=&quot;*&quot;>Every six months<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q18&quot; value=&quot;Once a year&quot; onclick=Q18.value=&quot;C&quot;>Once a year<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q18&quot; value=&quot;Never&quot; onclick=Q18.value=&quot;C&quot;>Near<br>

</ol>
<B>B7. Choose the objects a kid should never touch:</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q19&quot; value=&quot;Refrigerator door&quot; onclick=Q19.value=&quot;A&quot;>Refrigerator door<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q19&quot; value=&quot;* Matches and lighters&quot; onclick=Q19.value=&quot;*&quot;>Matches and lighters<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q19&quot; value=&quot;Baseball balls and bats&quot; onclick=Q19.value=&quot;C&quot;>Baseball balls and bats<br>

</ol>
<B>B8. An electrical cord becomes a fire hazard when it is?</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q20&quot; value=&quot;Placed along the wall&quot; onclick=Q20.value=&quot;A&quot;>Placed along the wall<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q20&quot; value=&quot;Laid on a rug&quot; onclick=Q20.value=&quot;B&quot;>Laid on a rug<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q20&quot; value=&quot;Laid on a wooden floor&quot; onclick=Q20.value=&quot;C&quot;>Laid on a wooden floor<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q20&quot; value=&quot;* Placed under a rug or a door&quot; onclick=Q20.value=&quot;*&quot;>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=&quot;radio&quot; NAME=&quot;Q21&quot; value=&quot;A funny tikling in the stomack&quot; onclick=Q21.value=&quot;A&quot;>A funny tikling in the stomack<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q21&quot; value=&quot;* A shock leading to probable death&quot; onclick=Q21.value=&quot;*&quot;>A shock leading to probable death<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q21&quot; value=&quot;A painfull shock&quot; onclick=Q21.value=&quot;C&quot;>A painfull shock<br>

</ol>

<B>B10. Why should toys or objects not be left lying around in the hall way or the stair</B>
<ol>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q22&quot; value=&quot;In order not to break the toy or object&quot; onclick=Q22.value=&quot;A&quot;>In order not to break the toy or object<br>

<INPUT TYPE=&quot;radio&quot; NAME=&quot;Q22&quot; value=&quot;* To prevent the risk of trippling over them and falling down&quot; onclick=Q22.value=&quot;*&quot;>To prevent the risk of trippling over them and falling down<br>


</ol>







<br><br>

<center>



<INPUT TYPE=&quot;reset&quot; NAME=&quot;reset&quot; VALUE=&quot;Clear&quot; onclick=clearquiz(this.form)>

<INPUT TYPE=&quot;submit&quot; VALUE=&quot;Send results&quot; onclick=scorequiz(this.form)>



<BR><BR>

<B>Your Quiz Score is </B><INPUT NAME=&quot;SCORE&quot; TYPE=&quot;text&quot;> </center>


</form>
<P>
</blockquote>
</BODY>
</HTML>


thank you for your help
 
You would also have to remove the line:

form.SCORE.value =eval(tally)

The problem in using javascript is that you can tell what the answers are just looking at the code.


Clive
 
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"...

anyone know why it's not working?
 
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top