Onlinequiz examination form.questions from database with random

good evening to every one,
This is narasimharao.I am creating online examination form with the following features.
1)questions from database with random order and score will be calculated after submiting the form.
2)form will automatically submited whenever the time is expired.timer will be displayed.
3)question one by one by provding prev and next options
I am getting the code individual while combining one and another it will not work properly.please help me