Quote:
Originally Posted by adamolekunfemi
I am to develop a quiz application.
DETAILS,
1. there is a table containing the following fields(questions,optionA,optionB,optionC,optionD and Answer)
2. the interface has one label and four radio buttons. I bound these to the table respectively
3. the challenge is how to validate the selected radio button against the "answer" fields. and then stepping forward for the next iteration while keeping count of the correct and wrong answer.
|
I am working on basically the same thing with 16 questions in a single page Form, using radiobuttons (A,B,C,D) and a single submit button at the bottom of the page. I have validation figured out and will post the code here this evening. My issue is getting CRUD (Create, Read, Update and Delete), specifically Create(Insert) to insert all the selections into my database table. So hopefully we can both work this all out here.
We may have different approaches to the exam.
My online exam presents the user with one single page Form (trying to keep it "simple") displaying 16 multiple choice questions (A,B,C,D) with a comment textarea below each question. I am using
RadioButtonList for the selections. Each RadioButtonList has a separate ID with
ListItem for each radiobutton. There is a single submit button at the very bottom after the last question. Upon clicking the button, validation checks to make sure a selection has been made (in other words ALL questions must be answered before submission is valid) for each question. If all questions are answered the user is sent to another page where the questions along with the selected answers and comments are displayed. My next step is to get all the selections inserted into my database table, which is proving to be THE challenge.
Check out my code here:
Multiple Choice Online Exam