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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help with online test creation

Status
Not open for further replies.

donkyho

Programmer
Oct 17, 2009
1
CA
I'm trying to create an online test and I am not very familiar with the radiobuttonlist control.


I have 3 classes..cTest, cQuestion, cAnswer...within cTest I have a generic list of cQuestions, within cQuestion, a generic list of cAnswers.


So my thought was that I could use foreach to display the questions and answers...which worked...however, I'm not sure how to retrieve the selected answers when the user clicks submit. Any ideas?


Also, is this the best way to do things? I like the idea of using generic lists, however would it be better to use DataSets and bind them to the RadioButtonLists?


Any help appreciated


Thanks
 
the model of :
a test has many questions
a question has many answers

makes sense. it would be logical to conclude you also have:
a user can take a test
a user has 0-1 answer per question on the test.

now, how you go about displaying the questions and answers is up to you. personally. I would navigate the user a question at a time with a X of Y questions remaining this would inform the user of where they are in the testing process.

You also need to handle how you will store the user's response to a question until they complete the entire test.

another option to consider what types of answers are there. multiple choice, true/false, free response, etc. encapsulating each of these types of questions behind an IAnswerType interface would be a good approach.

your last question: DataSets very generic lists. I do not use datasets/tables unless I absolutely have to. This is usually when I'm interacting with a reporting tool like Crystal Reports.

Other than that I use the POCO (plain old compiled object) approach. I find this allows me to explicitly express the intent of the model. I can also interact easily with proxy generators, if needed. mapping these POCO's to the database (assuming there is one) is done with NHibernate, an Object Relational Mapper(ORM).

for more information google any of the topics/key words above. there is plenty of information on the web.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top