Hi All,

I am developing online examination process using jsp. The questions and options are fetched from the text files. For each page i am displaying one question and four options. I am calculating the answers by using radio button. I given a next button and previous button for navigation.

My problem is while going to the previously answered question the selected radio button is deselected. I have to set the radio button as selected.
Please give some ideas to solve this problem.

Advance thanks.

Session is what you need to maintain

I am not using session. I just writing the selected answers in a text file and using the text file i am validating the answers.

while going to previous the selected radio value should remain selected. But in my case it is deselected.


You need to use a session to keep track of what the user has entered, then during the loading of each page, you can check whether a session key exists for that question, and if so, check the radion button for that answer checked.

Peter's answer was a suggestion of what you should do, not a question about what you are doing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.