Location: PHPKode > projects > E2Exam: LAMP for the Education > question.php
<?
if(!isset($eidmo)){
?><script language="javascript">
<!--
	alert("There seems to be an error. Please try again.\n   The system will now close the exam window and prompt you to login.\n If problem reoccur, inform the proctor.\n Thank very much.");
	self.close();
//-->
</script>
<?
} else {

echo '<html>';

require("db.php");

echo '<head>';
echo '<title>Questionnaire</title>';
if(!isset($min) || $min==0) $m = 0;
if(!isset($sec) || $sec==0) $s = 0;

echo '</head>';

if(isset($scorena)){
$sql = "select * from ExamAnswers where EID='".$eidmo."'";
$res = mysql_query($sql);
$tot = mysql_num_rows($res);
$scor=0;
while($r=mysql_fetch_array($res)){
	$s = "Select a.ANS as C,e.ANS as A from Answers a,ExamAnswers e where a.QID=e.QID and e.EID='".$eidmo."' and a.ANS=e.ANS";
	if($u = mysql_query($s)){
		$scor = mysql_num_rows($u);
	}
}
$perc = ($scor/$tot)*100;
}
echo '<body topmargin="0" leftmargin="0">';
echo '<div align="center">';
echo '<center>';
echo '<table cellspacing="0" cellpadding="0" border="0">';
echo '<tr>';
echo '<td width="100%" height="95%" align="center" valign="middle">';
echo '<table border="0" cellpadding="0" cellspacing="0" width="450" style="border-collapse: collapse" bordercolor="#111111" height="294">';
echo '<tr>';
echo '<td colspan="2" style="border-style:solid; border-width:1px; padding:0; color:#FFFFFF; font-family:Tahoma; font-size:14pt; font-weight:bold; background-color:#008080" bgcolor="#008080" align="center" height="25">Congratulations!</td>';
echo '</tr>';
echo '<tr>';
echo '<td colspan="2" style="border-left:1px solid #008080; border-right:1px solid #008080; padding:0; font-family:Tahoma; font-size:12pt; font-weight:bold" align="center" height="56">';
echo 'You have completely answered all questions.';
echo '</td>';
echo '</tr>';
	if(!isset($scorena)){
echo '<tr>';
echo '<td valign="top" style="border-left:1px solid #008080; border-right:1px solid #008080; padding:0; font-family:Tahoma; font-size:12pt; font-weight:bold" align="center" height="21">';
echo 'What would you like to do next?</td>';
echo '</tr>';
echo '<tr><form method="post" action="'.$PHP_SELF.'">';
echo '<input type="hidden" name="eidmo" value="'.$eidmo.'">';
echo '<td valign="top" style="border-left:1px solid #008080; border-right:1px solid #008080; padding:0; font-family:Tahoma; font-size:12pt; font-weight:bold" align="center" height="28">';
echo '<input type="submit" value="View Score" name="scorena" style="width: 150" onclick="this.submit();this.disabled=true;"></td>';
echo '</form>';
echo '</tr>';
	}else{
echo '<tr>';
echo '<td style="border-left:1px solid #008080; border-right:1px solid #008080; padding:0; font-family:Tahoma; font-size:12pt; font-weight:bold" align="center" height="141">';
echo 'Your Score is:';
echo '<br><font size="4" color="#336699">'.$scor.'&nbsp;/&nbsp;'.$tot.'</font>';
# echo '<p>A Percentage of:';
# echo '<br><font size="4" color="#336699">'.round($perc,2).'%</font>';
echo '</td>';
echo '</tr>';
	}
echo '<tr>';
echo '<td valign="top" style="border-left:1px solid #008080; border-right:1px solid #008080; border-bottom:1px solid #008080; padding:0; font-family:Tahoma; font-size:12pt; font-weight:bold" align="center" height="28">';
echo '<input type="button" value="Log Off" name="logoff" style="width: 150" onclick="top.window.close();"></td>';
echo '</tr></table>';
echo '</td></tr><tr><td align="center" style="font-family: Tahoma; size=1; color=#336699; font-size:2mm; font-weight:bold">aoc</td></tr></table>';
echo '</center></div></body></html>';

}
?>
Return current item: E2Exam: LAMP for the Education