Guess you know or hard of Cisco online examinations!

In my project am to implement some thing of that kind! i have done most and one part still failing where i need you help!

With lots of questions in a database each with a subject, 4 different objective answers,with the right Ans and a year of the question it was examined in an examination board. when some body selects the subject and year to do, then the respective questions are displayed using the while loop with for the sql statement
PHP Code:
$sql mysql_query("select * from questions where Subject = '$subject' and Year = '$year'"
Well i can have all the questions displayed with there objective ans choices but after one submits the paper how should i start marking the questions to determine the right and wrongs meaning i can identify each question!

Please Help me thanks