<?php include "students_02_info.php" ; ?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Untitled Document</title>

<link href="style.css" rel="stylesheet" type="text/css" />


</head>

<body>
<div id="frame">
This is the answer file. 

<?php 
$qnum= $_POST['questionnumber'];
$qanswer= $_POST['answertomatch'];
$uanswer= $_POST['answeredname'];

if($uanswer==$qanswer){
echo "you got it right!";	
?>
<a href="students_02_form_quiz.php" > Let's ask another question! </a>
<?php
}


//else{
	
else if(!($uanswer==$qanswer)){
echo "you got it wrong. The you said $uanswer but the answer is $qanswer. ";	
?>
<form method="post" action="students_02_form_answer.php">
<input type="text" name="answeredname" />
<input type="hidden" name="questionnumber" value="<?php echo $qnum; ?>" />
<input type="hidden" name="answertomatch" value="<?php echo $studentnames[$qnum]; ?>" />
<input type="submit" name="submit" value="submit" />

</form>
<?php
}



echo "<div id=\"students\"> <img src=\"$studentphotos[$qnum]\" width=\"50px\"><br></div>" ;


?>


</div>
</body>
</html>