How to check if the selected value from RadioButtonList is the correct answer? (1 Viewer)

pantelis

New member
Local time
Today, 18:18
Joined
Mar 13, 2013
Messages
2
Hello guys,
I have a problem with the comparison of selected value of RadioButtonList with the correct answer. Well I have a database named Quiz.accdb and i have 2 tables Questions with 2 columns : "Question id" and "title" and Choices with 6 columns on it : "Answer id" , "Question id"(to be in relation with Question id of Questions table and get all the four choices), "1st choice", "2nd choice", "3rd choice", "4th choice" and "Correct Answer". I have 2 DetailsView, one at top which shows the title of the Question(id is not visible) and the other DetailsView that shows the 4 choices(whatever is the id of the question from the first DetailsView, it shows the 4 choices of that question in the other DetailsView). I have made a RadioButtonList with 4 items on it : A with value 1, B with value 2, C with value 3 and D with value 4. How is it possible to check if the user answers correctly after pressing the button for the next question. I have made my first website and i stuck on that. I am using C# by the way and Visual Web Developer 2008.
I would appreciate it if you can help me.

Thanks in advance.
Pantelis G.
 

smithdavid

Registered User.
Local time
Today, 10:18
Joined
Jun 26, 2013
Messages
13
Take the value of correct answer and user selected answer in two seprate variable,then compare that variableif both of them are same then the user answer is correct otherwise false.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom