Topic: Designing a data mining schema
A client of mine would like me to implement a data mining form to gather some demographics before releasing a new product. It will be implemented as a single form of questions on the home page of the site. The questions will be pretty standard - age, sex, email, plus some short-answer questions.
I am struggling with how to best model this. Right now, I'm thinking:
:question => :string
:question_id => :integer
:answer => :string
Question :has_many Answers
So the views would take care of giving the options for the questions. For example, I would hard code the options for age as an array in the view like:
["under 18", "28-35", "36-45", "46-55", "55+]"
Obviously this would work, but I also want to include some more info to be stored with each answer. For example, I would like to keep all of the answers from one form submittal together. But in order to accomplish this, I would have to make another column in the answers table (:remote_ip => :string). I suppose it would work, but for some reason, it just doesn't feel DRY; I'm thinking that it could be modeled a little bit cleaner/clearer. Any ideas for alternate implementations? Perhaps an implementation that would allow me to push the options for each multiple-choice question into the database, rather than hard coding them into the views?
Last edited by jed.hurt (2007-04-23 00:27:54)