I'm
currently develop a system which name is driving test sample questions using C#.NET and SQL Server2005
suppose user enter answer through the interface which is made up of option/
radio button.
user have to answer few question before getting the result and each answer
entered then compare with the value stored in database. Each answer entered by
user from each question will form a pattern of solution that will have specific
result. Noted i also wanted to store result in database.
plz help.
If u have any code or tutorial plz send me to this email address:[email protected]
Loading
Sam HobbsPosted Nov 11, 2009, 6:13 PM
Sam HobbsPosted Nov 11, 2009, 6:09 PM
I don't know what you mean by "store result in database"; do you need to store all the answers that the person taking the test provided or do you just need to store the number correct or something else?
I think that the table of correct answers just needs to have two columns. One column for the question number and another column for the correct answer. The answer will be a number from zero to 3 or from 1 to 4.
In the form that gives the test, you will have four Radio Buttons inside a Group Box. Radio Buttons must be inside a Group Box in order for Windows to know that they are related. You can use the RadioButton.Checked property to determine which is checked; only one RadioButton inside of a specific Group Box can be checked. So then you can compare the number of the RadioButton (0 to 3 or 1 to 4) to the correct answer corresponding to the question.
Ever GreenPosted Nov 6, 2009, 2:56 PM
I have 20 driving test questions and every question has four answer(radio button).User will be able to choose only one answer and these answer will store to a DB when they will click next button. After finishing the exam , when user will click the finish button ,user's answer will compare with correct answer which is stored in the data base before and it will show how many questions are correct and how many are wrong and user score.
plz don't mind for my lack of knowledge in this field cause i am very new in this field.
I read your reply , although i didn't understand how many table i need to create ( 2 or 3 tables).
According to ur answer---
Method 1: I need to create only one table-- right?
I need 21 columns-- one for User_id and 20 for 20 questions--am i right?
How to store radiobutton values to the table of the db when user will click the next button.
plz help.
Method 2:
I need to create two table-- one is Patterntable and another one is resulttable.
Do you have any code or project or example related to this problem?
Nilanka DharmadasaPosted Nov 5, 2009, 11:16 PM
Your question is not very clear for me. As I understand, you want to store the result in the database.
1st method is designing your table with following columns.
user_id - int
question1 - int
question2 - int
etc..
2nd method
Create two tables:
1st one:
Pattern table:
pattern_id - int
pattern - varchar (this column will display the pattern like 13245 )
etc..
Result table:
user_id - int
pattern_id - int
This table forms a foriegn key relation ship with the first table.
If your problem is not answered let me know. If it is answered please accept my answer.