I am planning to write an Examination system but i have some question about how i can start my system

what a questions?

I need an algorthm for this Examination system

in my program I have one of the tables called question which has 6 fields
1 question contain the question
2 option1 contain the first option
3 option2 contain the second option
4 option3 contain the third option
5 option4 contain the forth option
6 correct choice { 1 for option 1
2 for option 2
3 for option 3
4 for option 4 }

My program reads questions from database then shuffles answers and display it for student (as you know after answer shuffling the position of options will change so the position of correct choice will change )

How can I know the new position of answer? What is the new value for last filed