Click here to Skip to main content
15,904,655 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
Every Body


The structure of the form is
Question textbox
Choice 1 textbox radiobutton 1
Choice 2 textbox radiobutton 2
Choice 3 textbox radiobutton 3
choice 4 textbox radiobutton 4
and save button

Suppose

Question - What is the capital of India?
and its choices are
Choice 1- SriLanka
Choice 2- India
Choice 3- NewYork
Choice 4- London

the correct answer is india and its id is 2

After inserting the data in three table it will look

tblQuestion
qid Question
-------------------
1 What is the capital of India?

tblAnswerChoice
ansid qid Choice
-------------------------
1 1 SriLanka
2 1 India
3 1 NewYork
4 1 London

tblAnswer

aid qid ansid
----------------------
1 1 2


Now my problem how to show the correct answer through radio button corresponding
the answer choice.
for above example the radiobutton 2 will be checked true
but it is possible to show the correct answer through radio button

Thanks.
Deepak
Posted
Updated 29-Sep-11 6:53am
v2
Comments
OriginalGriff 29-Sep-11 10:30am    
I hope the other questions on this quiz are better than that example: The "cabital" of India is 'I' or "New Delhi", not "India"
RaisKazi 29-Sep-11 11:16am    
Good Catch :)
aryan2010 29-Sep-11 10:51am    
can you explain what you to say?
Muralikrishna8811 29-Sep-11 11:15am    
Hi,
here two things
one is change database designing maintain one table for this
like
qid,opt1,opt2,opt3,opt4,ans

Second one is you've to show correct answer in green color or something else
not through radio buttton
aryan2010 29-Sep-11 11:58am    
is it possible to show the right answer through radio button or not?

1 solution

Of course it's possible. Determine which radio button you want checked and set its Checked property to true.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900