Jump to content

form checking during quiz


lanceox

Recommended Posts

Hi guys.

I have a quiz and everything works fine now but what im trying to figure out is, if there is a way to submit each question and get the results there and then rather than using sessions and getting a final quiz results page.

 

Hope this can be done.  The code i use is attached.

For example. the user will answer q1 but then submit each question rather than all at once and then get feedback after each question.

Thanks for all your help guys  :)

 

Lance

 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Forensics E-learning Package</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="toplinks">

</div>
</div>
<div id="menu">
	<ul>
		<li><a class="selected" href="home.html">Home</a></li>
		<li><a href="initialquiz.php">Initial Quiz</a></li>
		<li><a href="about.php">About</a></li>

	</ul>
  </div>
<div id="content">
	<div id="main">
        <h1>Initial Quiz</h1><BR />
        <form name="Forensics Test" method="post" action="detection.php">
        <h1>Protection</h1>
<hr />
<b>1. What does an IDS do? <BR /><BR /></b>
<UL>
<? if($attempted == true && !isset($q1)) { echo 'bgcolor="#FFFFCC"'; } ?>
<input type="radio" name="q1" id="q1a" value="1" />An IDS evaluates a suspected intrusion once it has taken place and signals an alarm<BR><? if($q1 == "1"){echo "checked=\"checked\"";} ?>
<input type="radio" name="q1" id="q1b" value="2">An IDS blocks intrusions before it happens and signal an alarm<BR><? if($q1 == "1"){echo "checked=\"checked\"";} ?>
<input type="radio" name="q1" id="q1c" value="3">An IDS blocks all intrusions before it happens and monitors the network, however does not signal an alarm.<BR><? if($q1 == "1"){echo "checked=\"checked\"";} ?></UL><hr />
<b>2. What does a Firewall do?<BR /><BR></b>
<UL>
<? if($attempted == true && !isset($q2)) { echo 'bgcolor="#FFFFCC"'; } ?>
<input type="radio" name="q2" id="q2a" value="1">Firewalls limit access once the intrusion is within a network and then signals an alarm.<BR><? if($q2 == "1"){echo "checked=\"checked\"";} ?>
<input type="radio" name="q2" id="q2b" value="2">Firewalls limit access between networks to prevent intrusion and do not signal an attack.<BR><? if($q2 == "1"){echo "checked=\"checked\"";} ?>
<input type="radio" name="q2" id="q2c" value="3">Firewalls limit access to a network and prevent all intrusions. An alarm to the user is raised.<br><? if($q2 == "1"){echo "checked=\"checked\"";} ?></UL><hr />
<p><b>3. What does Tripwire do?</b> </p>
<UL>
<? if($attempted == true && !isset($q3)) { echo 'bgcolor="#FFFFCC"'; } ?>
<input type="radio" name="q3" id="q3a" value="1">Tripwire does not protect from intrusions however signals an alarm to the user that network intrusions are occurring.<BR><? if($q3 == "1"){echo "checked=\"checked\"";} ?>
<input type="radio" name="q3" id="q3b" value="2">Tripwire does not perform system integrity checks in terms of file change, however does prevent access to a network unless otherwise stated.<BR><? if($q3 == "1"){echo "checked=\"checked\"";} ?>
<input type="radio" name="q3" id="q3c" value="3">Tripwire helps identify changes in files. Tripwire records a set of information about all the important files in your server in case of a change.</p><? if($q3 == "1"){echo "checked=\"checked\"";} ?>
<BR>
</UL><hr />
<p><b>4. What type of files does a traditional anti-virus protect you from?</b> </p>
<UL>
  <? if($attempted == true && !isset($q4)) { echo 'bgcolor="#FFFFCC"'; } ?>
  <input type="radio" name="q4" id="q4a" value="1">Viruses and tracking cookies<BR><? if($q4 == "1"){echo "checked=\"checked\"";} ?>
  <input type="radio" name="q4" id="q4b" value="2">Rootkits and Viruses<BR><? if($q4 == "1"){echo "checked=\"checked\"";} ?>
  <input type="radio" name="q4" id="q4c" value="3">Worms and Rootkits<BR><? if($q4 == "1"){echo "checked=\"checked\"";} ?>
</UL><hr />
<p><b>5. What does an Anti-root kit protect you from?</b> </p>
<UL>
  <? if($attempted == true && !isset($q5)) { echo 'bgcolor="#FFFFCC"'; } ?>
  <input type="radio" name="q5" id="q5a" value="1">Anti-rootkit protects from only viruses, key loggers and backdoors.<BR><? if($q5 == "1"){echo "checked=\"checked\"";} ?>
  <input type="radio" name="q5" id="q5b" value="2">Anti-rootkit protects from viruses, backdoors, spyware and key loggers as a collection.<BR><? if($q5 == "1"){echo "checked=\"checked\"";} ?>
  <input type="radio" name="q5" id="q5c" value="3">Anti-rootkit protects from only viruses and backdoors.<BR><? if($q5 == "1"){echo "checked=\"checked\"";} ?>
</UL>
<HR><BR /><BR />
<input type="submit" value="Go to Next Section" />
</form>


          
        
        </div>
	<div id="right">
	<h2>Right Menu</h2>
	<div class="rightitem">
		<ul>
		<li><a class="selected" href="home.html">Home</a></li>
		<li><a href="initialquiz.php">Initial Quiz</a></li>
		<li><a href="about.php">About</a></li>
		</ul>
	</div>
  </div>
  </div>
<div class="clearbottom"></div>
<div id="footer">
	<p id="legal"> </p>
</div>
</div>
</div>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.