Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Choice Exam in C#

Status
Not open for further replies.

TimmyC1983

Programmer
Nov 18, 2008
2
GB
Hi there,

I'm looking to create a small Multiple Choice Exam for a side project of mine. For each question I would like there to be a text question, then a selection of four answers. The user then could submit his answer and after say 10 questions his score could be produced (you get the picture :p).

Anyway I'm actually after some advise as to how to implement this. Which technique do you think I should use to store questions and answers? Database, XML, text files? Could anyone give me any tips on how to do this?

Thanks in advance,

Tim.
 
yes a database. xml & text files are not meant for this type of usage.

For the GUI I would see the user answering 1 question at a time and at the end getting the results.

I would create a controller which gets data from the domain and passes the data to the view (web page).

The domain would contain the entities:
Question
Answer
User
Quiz

where
A Quiz has many Questions which has many Answers
A Question has a correct Answer
A User has many Quizzes which has many Questions which has a Selected Answer
A User has a current Quiz with Answered and Unanswered Questions.

then I would use an ORM like ActiveRecord or NHibernate to map the domain to a database.

when the user logs in have them select a quiz. Then have them them step through each question of the quiz. when all questions are answered redirect them to the results page.

this is a high level view looking at the problem from the domains perspective.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top