C# .NET - How can I create a quiz game in C# web application

Asked By elodie lodios on 21-Dec-12 08:48 AM
Hello,

I want to create a quiz game in C# using Visual Studio 2010. I want to display a question and then propose a set of 4 answers.  if you click to the wrong answer the button becomes red and become green if you click to the correct one.
I have designed the interface for the game form but I don't know which codes I should use in the back end to retrieve question from my SQL database and display them on my game form.
Here is a small snapshot of my database, to let you see how is my tables in the database.

Thank you for helping.




Robbe Morris replied to elodie lodios on 21-Dec-12 12:57 PM
There should be a fourth table called Answer and remove the answer columns from the Question table.  This design would also enable you to create numerous random inaccurate answers so people couldn't "game" your test.

AnswerID
QuestionID
IsActive (bit to enable you to remove out of date answers without losing historical data)
Title
IsCorrect
AnswerExplanation
SortOrder

Of course, you'd need an ActualAnswer table to store the results:

ActualAnswerID
QuestionID
AnswerID
UserID