»
EnglishFrenchVietnamese

Print - Javascript Questions script - JavaScriptBank.com

Full version: jsB@nk » Utility » Quiz » Javascript Questions script
URL: https://www.javascriptbank.com/javascript-questions-script.html

Javascript Questions script © JavaScriptBank.comUse this JavaScript to create quizzes for tutorials, online classes, or other subjects.

Full version: jsB@nk » Utility » Quiz » Javascript Questions script
URL: https://www.javascriptbank.com/javascript-questions-script.html



JavaScript
<SCRIPT language=javascript>/*    By: Aaron Connelly   Email: [email protected]   This script is the property of Aaron Connelly  Must stay intact for use*/function animateQuestion(){//The wrong variable. The W shows on the left side of the //question if the person gets the answer wrongvar Wrong="<font color='red' size=3><B>W</B></font>"//The Right variable. The C shows on the left side of the //question if the person gets the answer right.var Right="<font color='red' size=3><B>C</b></font>"//The Message you say to the visitor if he/she gets a perfect score.var perfectScore="CONGRATULATIONS on getting a perfect Score!"//The Message you say to the visitor if he/she's score is between 50-90var Score5090="Good Job!"//The Message you say to the visitor if he/she's score is below 50var below50="Not so good!"//Don't EDIT Below this linevar percent="100"if(document.forms[0].A1.checked){document.all.Wrong1.innerHTML=Rightvar subtract1=0}else{document.all.Wrong1.innerHTML=Wrongvar subtract1=10}if(document.forms[0].A2.checked){document.all.Wrong2.innerHTML=Rightvar subtract2=0}else{document.all.Wrong2.innerHTML=Wrongvar subtract2=10}if(document.forms[0].A3.checked){document.all.Wrong3.innerHTML=Rightvar subtract3=0}else{document.all.Wrong3.innerHTML=Wrongvar subtract3=10}if(document.forms[0].A4.checked){document.all.Wrong4.innerHTML=Rightvar subtract4=0}else{document.all.Wrong4.innerHTML=Wrongvar subtract4=10}if(document.forms[0].A5.checked){document.all.Wrong5.innerHTML=Rightvar subtract5=0}else{document.all.Wrong5.innerHTML=Wrongvar subtract5=10}if(document.forms[0].A6.checked){document.all.Wrong6.innerHTML=Rightvar subtract6=0}else{document.all.Wrong6.innerHTML=Wrongvar subtract6=10}if(document.forms[0].A7.checked){document.all.Wrong7.innerHTML=Rightvar subtract7=0}else{document.all.Wrong7.innerHTML=Wrongvar subtract7=10}if(document.forms[0].A8.checked){document.all.Wrong8.innerHTML=Rightvar subtract8=0}else{document.all.Wrong8.innerHTML=Wrongvar subtract8=10}if(document.forms[0].A9.checked){document.all.Wrong9.innerHTML=Rightvar subtract9=0}else{document.all.Wrong9.innerHTML=Wrongvar subtract9=10}if(document.forms[0].A10.checked){document.all.Wrong10.innerHTML=Rightvar subtract10=0}else{document.all.Wrong10.innerHTML=Wrongvar subtract10=10}var total=subtract1+subtract2+subtract3+subtract4+subtract5+subtract6+subtract7+subtract8+subtract9+subtract10c=100-totalif(c==100){document.all.Percent.innerHTML="<b>Your Score is - " + c + "% - " + perfectScore}else if(c>=50 && c<=90){document.all.Percent.innerHTML="<b>Your Score is - " + c + "% - " + Score5090}else{document.all.Percent.innerHTML="<b>Your Score is - " + c + "% - " + below50}document.all.Percent.style.color="blue"}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION1--><FONT color=black><B>How many hours does a Lion usually sleep?</B> </FONT></TD>    <TD>      <DIV id=Wrong1></DIV></TD></TR>  <TR>    <TD><!--ANSWERS1-->A)<B> 10</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B)<B> 15</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>C) <B>20</B> </TD>    <TD><INPUT type=checkbox name=A1 value="ON"> </TD></TR>  <TR>    <TD>D) <B>24</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION2--><FONT color=black><B>What type of mammal is a collie?</B></FONT> </TD>    <TD>      <DIV id=Wrong2></DIV></TD></TR>  <TR>    <TD><!--ANSWERS2-->A) <B>Cat </B></TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>Dog</B> </TD>    <TD><INPUT type=checkbox name=A2 value="ON"> </TD></TR>  <TR>    <TD>C) <B>Camel</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>D) <B>Bird</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION3--><FONT color=black><B>What part of your body gives you balance?</B> </FONT></TD>    <TD>      <DIV id=Wrong3></DIV></TD></TR>  <TR>    <TD><!--ANSWERS3-->A) <B>Mallus</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>Stapes</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>C) <B>Semilunar Canal</B> </TD>    <TD><INPUT type=checkbox name=A3 value="ON"> </TD></TR>  <TR>    <TD>D) <B>Arms </B></TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION4--><FONT color=black><B>What&#39;s 100+200-100+500-100(2) ??</B> </FONT></TD>    <TD>      <DIV id=Wrong4></DIV></TD></TR>  <TR>    <TD><!--ANSWERS4-->A) <B>500</B> </TD>    <TD><INPUT type=checkbox name=A4 value="ON"> </TD></TR>  <TR>    <TD>B) <B>550</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>C) <B>300</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>D) <B>0 </B></TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION5--><FONT color=black><B>When writing a letter what does x&#39;s and o&#39;s mean</B> </FONT></TD>    <TD>      <DIV id=Wrong5></DIV></TD></TR>  <TR>    <TD><!--ANSWERS5-->A) <B>I want to play TicTacToe</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>I&#39;ll be home soon</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>C) <B>Hug&#39;s</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>D) <B>Hug&#39;s + kiss&#39;s </B></TD>    <TD><INPUT type=checkbox name=A5 value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION6--><FONT color=black><B>Are Java and Javascript the same because of their names?</B> </FONT></TD>    <TD>      <DIV id=Wrong6></DIV></TD></TR>  <TR>    <TD><!--ANSWERS6-->A) <B>YES</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>NO</B> </TD>    <TD><INPUT type=checkbox name=A6 value="ON"> </TD></TR>  <TR>    <TD>C) <B>POSSIBLE</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>D) <B>What&#39;s Java &amp; Javascript </B></TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION7--><FONT color=black><B>What Browser has the most DHTML Extentions?</B> </FONT></TD>    <TD>      <DIV id=Wrong7></DIV></TD></TR>  <TR>    <TD><!--ANSWERS7-->A) <B>Netscape</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>Internet Explorer</B> </TD>    <TD><INPUT type=checkbox name=A7 value="ON"> </TD></TR>  <TR>    <TD>C) <B>Microsoft Express</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>D) <B>Others </B></TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION8--><FONT color=black><B>What Month did Columbus discover America?</B> </FONT></TD>    <TD>      <DIV id=Wrong8></DIV></TD></TR>  <TR>    <TD><!--ANSWERS8-->A) <B>September</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>November</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>C) <B>July</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>D) <B>October </B></TD>    <TD><INPUT type=checkbox name=A8 value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION9--><FONT color=black><B>Who was our first President?</B> </FONT></TD>    <TD>      <DIV id=Wrong9></DIV></TD></TR>  <TR>    <TD><!--ANSWERS9-->A) <B>Thomas Jefferson</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>Goerge Washington</B> </TD>    <TD><INPUT type=checkbox name=A9 value="ON"> </TD></TR>  <TR>    <TD>C) <B>Grant</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>D) <B>John Adams</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><TABLE width=500 border=2>  <TBODY>  <TR>    <TD bgColor=skyblue><!--QUESTION10--><FONT color=black><B>Who wrote the &quot;Scralet Letter&quot;</B> </FONT></TD>    <TD>      <DIV id=Wrong10></DIV></TD></TR>  <TR>    <TD><!--ANSWERS10-->A) <B>Cooper</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>B) <B>Longfellow</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR>  <TR>    <TD>C) <B>Hawthorne</B> </TD>    <TD><INPUT type=checkbox name=A10 value="ON"> </TD></TR>  <TR>    <TD>D) <B>Poe</B> </TD>    <TD><INPUT type=checkbox name="" value="ON"> </TD></TR></TBODY></TABLE><CENTER><BR><DIV id=Percent></DIV><BR><INPUT style="FONT-WEIGHT: bold; COLOR: black; BACKGROUND-COLOR: skyblue" onclick=animateQuestion() type=button value=" - Correct The Test - "> </CENTER></FORM><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->