Forum Index
SUBSIM Forum Search

The Web's #1 BBS for all submarine and naval simulations!
[ SUBSIM Review ] [ SUBSIM STORE ]
Current Forum | Archives 2002-2003 |

Java script quiz

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> General Topics
View previous topic :: View next topic  
Author Message
Drebbel



Joined: 10 Jan 2002
Posts: 6153
Location: Almost at periscope death !

PostPosted: Sun Feb 13, 2005 12:26 pm    Post subject: Java script quiz Reply with quote

I know zilth about Java script, but managed to get a quiz script running on the site. Even managed to tweak it to my needs.

But can not tweak the code in such a way that one gets a popup message in case not all boxes are checked.

Script is running at: http://dutchsubmarines.com/quiz/submarine_service_quiz_jan_2005.htm

Any suggestions ?

Code:
<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>


<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-gb">
<meta name="DESCRIPTION" content="Pictures, photos and images of Dutch submarines">
<meta name="KEYWORDS" content="photo, picture, gallery, image, submarine, dutch, netherlands, navy, u-boats, u-boot, nato, sousmarines,holland, niederlanden, pays-bas, west, east, oost, indies, rnn, rnln, duikboot, onderzeeboot, onderzeer, onderzeeer, submarines, duikboten, koninklijke, marine, km, wwII, world, war, two, second, torpedoes, history, shnorkel, schorchel">
<title>Dutch Submarine Service Quiz</title>
<link href="/css/stylesheet.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!--
window.name = "cpst"
var score =0
var result =99
function verif(form) {
form.value=""
//- Lets find out how well they scored ---------------------
if ( form.question1[0].checked ) score++
if ( form.question2[1].checked ) score++
if ( form.question3[2].checked ) score++
if ( form.question4[3].checked ) score++
if ( form.question5[0].checked ) score++


if (score==0) alert ("You have "+score+" good answers. A job as a farmer seems more suited for you :-) of een andere grappige tekst.")
if (score==1) alert ("You have only "+score+" good answer. You seem like a good hand to swap the decks !")
if (score==2) alert ( "You have "+score+" good answers. Not too bad ! There will be a sailors job opening for you anytime !")
if (score==3) alert ("You have "+score+" good answers. Pretty Good ! We would like to send you to the Naval Academy, you are officers material !")
if (score==4) alert ("You made only one mistake. Well done ! A captains job would be perfect for you !")
if (score==5) alert ("Congratulations, you have the perfect score ! We can use Admirals like you !")
result=score
score=0
}

function exp(form) {
if (result<99){
win= window.open ("answers_jan_2005.htm", "Answers","height=530,width=500")
}
else {alert ("Hey you cheater ! Do the quiz atleast once !")}
 }
// -->
</SCRIPT>
</head>
<body background="/images/background.jpg" bgcolor="#C0C0C0" bgproperties="fixed" link="#0000FF" vlink="#800080"><hr size="4" color="#000000" noshade>
<script language="JavaScript">

</script>

<div align="center">
  <center>
  <table border="0" width="98%">
    <tr>
      <td width="10%"><img src="/images/jollyroger.gif" alt="Jolly Roger" width="61" height="41"></td>
      <td width="33%" align="center"><strong><font color="#FF0000">
      <span class="Page_header_section_title">www.DutchSubmarines.com</span></font><span class="Page_header_section_title"><font size="6" face="Courier New" color="#FF0000"></font></span><font size="6" face="Courier New" color="#FF0000"><br>
      <span class="Page_header_title">Dutch Submarine Service Quiz</span></font></strong></td>
      <td width="10%" align="right">
      <img src="/images/jollyroger.gif" alt="Jolly Roger" width="61" height="41"></td>
    </tr>
  </table>
  </center>
</div>
<hr noshade size="4" color="#000000">

<br>
<center><b>CORRECT ANSWERS ARE: A B C D A</b></center>
<br>


<FORM name =" qcm" >
<div align="center">
  <p>&nbsp;</p>
  <p>Do the quiz and find out what job we could use you for ! <br>
    (this page uses java and popups)
  </p>
  <p>&nbsp;</p>
  <table border="0" width="95%" cellspacing="1" cellpadding="3">
    <tr>
      <td align="center" bgcolor="#0099FF"><strong class="Table_blue_title"> <font face="Courier New" size="4">Question 1</font></strong></td>
    </tr>
  </table>

    <p>Picture of a submarine, port, aparatus, captain, etcetera <b><font face="Arial, Helvetica, sans-serif" size="6" color="#0033FF">  </font></b></p>
  <table border="0" width="450">
    <tr>
      <td>
        <table width="100%" border="0" cellpadding="3" cellspacing="1">
          <tr>
            <td valign="top">
              <p align="center">
                <INPUT NAME="question1" TYPE=radio VALUE="0" onclick=0>
                Answer A<BR>
                 <INPUT NAME="question1" TYPE=radio VALUE="0" onclick=0>
                 Answer B<BR>
                 <INPUT NAME="question1" TYPE=radio VALUE="0" onclick=0>
                 Answer C<BR>
                 <INPUT NAME="question1" TYPE=radio VALUE="0" onclick=0>
                 Answer D<BR>
              </p>
              </td>

          </tr>
        </table>
      </td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>

    <table border="0" width="95%" cellspacing="1" cellpadding="3">
    <tr>
      <td align="center" bgcolor="#0099FF"><strong class="Table_blue_title"> <font face="Courier New" size="4">Question 2</font></strong></td>
    </tr>
  </table>
  <p>Picture of a submarine, port, aparatus, captain, etcetera <b><font face="Arial, Helvetica, sans-serif" size="6" color="#0033FF"> </font></b></p>
  <table border="0" width="450">
    <tr>
      <td><table width="100%" border="0" cellpadding="3" cellspacing="1">
          <tr>
            <td valign="top"><p align="center">
                <INPUT NAME="question2" TYPE=radio VALUE="0" onclick=0>
              Answer A<BR>
              <INPUT NAME="question2" TYPE=radio VALUE="0" onclick=0>
              Answer B<BR>
              <INPUT NAME="question2" TYPE=radio VALUE="0" onclick=0>
              Answer C<BR>
              <INPUT NAME="question2" TYPE=radio VALUE="0" onclick=0>
              Answer D<BR>
            </p></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>

    <table border="0" width="95%" cellspacing="1" cellpadding="3">
    <tr>
      <td align="center" bgcolor="#0099FF"><strong class="Table_blue_title"> <font face="Courier New" size="4">Question 3</font></strong></td>
    </tr>
  </table>
  <p>Picture of a submarine, port, aparatus, captain, etcetera <b><font face="Arial, Helvetica, sans-serif" size="6" color="#0033FF"> </font></b></p>
  <table border="0" width="450">
    <tr>
      <td><table width="100%" border="0" cellpadding="3" cellspacing="1">
          <tr>
            <td valign="top"><p align="center">
                <INPUT NAME="question3" TYPE=radio VALUE="0" onclick=0>
              Answer A<BR>
              <INPUT NAME="question3" TYPE=radio VALUE="0" onclick=0>
              Answer B<BR>
              <INPUT NAME="question3" TYPE=radio VALUE="0" onclick=0>
              Answer C<BR>
              <INPUT NAME="question3" TYPE=radio VALUE="0" onclick=0>
              Answer D<BR>
            </p></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
 
  <table border="0" width="95%" cellspacing="1" cellpadding="3">
    <tr>
      <td align="center" bgcolor="#0099FF"><strong class="Table_blue_title"> <font face="Courier New" size="4">Question 4</font></strong></td>
    </tr>
  </table>
  <p>Picture of a submarine, port, aparatus, captain, etcetera <b><font face="Arial, Helvetica, sans-serif" size="6" color="#0033FF"> </font></b></p>
  <table border="0" width="450">
    <tr>
      <td><table width="100%" border="0" cellpadding="3" cellspacing="1">
          <tr>
            <td valign="top"><p align="center">
                <INPUT NAME="question4" TYPE=radio VALUE="0" onclick=0>
              Answer A<BR>
              <INPUT NAME="question4" TYPE=radio VALUE="0" onclick=0>
              Answer B<BR>
              <INPUT NAME="question4" TYPE=radio VALUE="0" onclick=0>
              Answer C<BR>
              <INPUT NAME="question4" TYPE=radio VALUE="0" onclick=0>
              Answer D<BR>
            </p></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>

    <table border="0" width="95%" cellspacing="1" cellpadding="3">
    <tr>
      <td align="center" bgcolor="#0099FF"><strong class="Table_blue_title"> <font face="Courier New" size="4">Question 5</font></strong></td>
    </tr>
  </table>
  <p>Picture of a submarine, port, aparatus, captain, etcetera <b><font face="Arial, Helvetica, sans-serif" size="6" color="#0033FF"> </font></b></p>
  <table border="0" width="450">
    <tr>
      <td><table width="100%" border="0" cellpadding="3" cellspacing="1">
          <tr>
            <td valign="top"><p align="center">
                <INPUT NAME="question5" TYPE=radio VALUE="0" onclick=0>
              Answer A<BR>
              <INPUT NAME="question5" TYPE=radio VALUE="0" onclick=0>
              Answer B<BR>
              <INPUT NAME="question5" TYPE=radio VALUE="0" onclick=0>
              Answer C<BR>
              <INPUT NAME="question5" TYPE=radio VALUE="0" onclick=0>
              Answer D<BR>
            </p></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p></p>
    <table border="0" align="center" cellpadding="3" cellspacing="1">
    <tr>
      <th scope="col"><input name="button1" type=Button value="How did I do ?" onClick="verif(this.form)"></th>
      <th scope="col"><input name="button2" type=Button value="I give up, tell me the answers!" onClick="exp(this.form)"></th>
    </tr>
  </table>
  <p>&nbsp;</p>
  <div align="center"></div>
</div>
</FORM>

Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Jesper



Joined: 14 Sep 2002
Posts: 2063
Location: Denmark (GMT+01.00)

PostPosted: Mon Feb 14, 2005 2:23 pm    Post subject: Reply with quote

dude that is one tough bish thing you are asking to have implementet without rewriting the entire script i think.

The best you can do is to find a better one or use one that is written in php instead.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> General Topics All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group