データベースに「質問」テーブルを作成するときに、アドバイスが必要です。各質問の質問番号を保存する必要がありますか、それとも自動インクリメントのおかげで各質問に固有のIDがあり、学生の場合はこれは必要ありません。試験を受けると、質問は生徒ごとにランダムな順序で表示されるため、回答をコピーすることはできません。
言い換えると、質問テーブルは次のようになります(例1)。
QuestionId (int 11) auto increment PK //unique identifier for each question
QuestionNo (int 3) //the question number
QuestionContent (varchar 800) //the question itself
AnswerId (int 11) //Foreign key to AnswerId in Answer Table
または、次のようにする必要があります(例2):
QuestionId (int 11) auto increment PK //unique identifier for each question
QuestionContent (varchar 800) //the question itself
AnswerId (int 11) //Foreign key to AnswerId in Answer Table