Here is the scenario,
At our online education firm we are creating an online quiz. The administrator feeds in
- the question
- 1 correct answer
- 4 incorrect answers
into the mysql database using a PHP form.
Here is what the table looks like
Now I would like to do two things:
-
Make a PHP page which retrieves let's say 10 random question/answers from the table and displays it on the PHP page with radio buttons and all for a user to check the right answer.
Can the following method be used to display retrieved info?
echo "<td>" . $row['question'] . "</td>";
echo "<td>" . $row['c_answer'] . "</td>";
echo "<td>" . $row['w_answer1'] . "</td>";
echo "<td>" . $row['w_answer2'] . "</td>";
echo "<td>" . $row['w_answer3'] . "</td>";
echo "<td>" . $row['w_answer4'] . "</td>"; Make a second PHP page which checks user submitted answer with the right results stored in the DB, script that checks and creates a scorecard.
How can I go about doing the 2 tasks?
All inputs appreciated.