Quick question about creating a basic grading system... please help asap
So I am building a quick online testing system. I have it setup so I can create multiple choice questions (all questions have exactly 4 answers), save the questions, answers, and the correct answer in mysql db, and have it randomly show 25 questions form the database on the actual testing page. I am stuck on how to actually get the results of what they click on.
This is the code to show the questions on the test page.
Code:
$result8 = mysql_query("SELECT * FROM sampletest ORDER BY RAND() LIMIT 25");
while($row8 = mysql_fetch_assoc($result8)) {
echo "<table width='200' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><div align='center'>";
echo $row8['question'];
echo "</div></td>
</tr>
<tr>
<td> <p align='center'>
<label>
<select name='";
echo $row8['id'];
echo "' size='5' id='";
echo $row8['id'];
echo "'>
<option value='";
echo $row8['a'];
echo "'>";
echo $row8['a'];
echo "</option>
<option value='";
echo $row8['b'];
echo "'>";
echo $row8['b'];
echo "</option>
<option value='";
echo $row8['c'];
echo "'>";
echo $row8['c'];
echo "</option>
<option value='";
echo $row8['d'];
echo "'>";
echo $row8['d'];
echo "</option>
</select>
</label>
<br /><hr>
</p></td>
</tr>
</table>";
}
But I don't understand how I would get the actual grading page to determine whether they have selected the correct answer for each unique question id.
Any more info I can give and I will.