ASP.NET Multiple Response Matrix

I am participating in a project to create a survey system. We knocked out logic for several types of questions, and I could use a second opinion on how best to proceed. We are running an ASP.NET 2.0 website using VB (VS2005) with an Oracle database.

In our oracle server we are planning some tables to order our data. There's a table for our polls, one for the questions (the keys determine which poll it goes on), one for the responses (again, the keys determine which question it belongs to), and one for collecting responses. Most questions only return one answer, and this is pretty easy to understand. However, when we start thinking about elements that return multiple responses, it starts to get complicated.

For example, if we have a simple 3x3 matrix filled with checkboxes. The lines are the days "Monday", "Wednesday", "Friday". The columns are actions such as Cycling, Running, Driving. The user checks each one they did for a specific day, so each line can have more than one answer. Another one we want to think about is what if instead of checkboxes we have textboxes where users write in quantity, how many minutes they spent on activity.

So far, for collecting responses, I've loved the idea of traversing the list of controls on a form and keeping tabs on the views that collect data. Since controls are created in code, they are usually assigned a line ID with a number attached to the end to keep track of what type of question it is and what its number is.

Question # 1: Should the data returned by the user be in a single delimited database record to separate each answer, or will each answer have its own record?

Question # 2: What is the best way to determine which answer follows which answer (in a survey)?

+1


source to share


2 answers


assuming that space and speed are unlikely to be serious constraints on this system, I suggest you normalize your data.

so the answer to question 1 is: each answer gets its own record; with a sequential number, if necessary



and the answer to question 2: foreign keys

0


source


Question # 1: Should the data returned from the user be in a single delimited database record to separate each answer, or will each answer have its own record?



I don't think so, I think you need to maintain a simple cross-reference table with question id and answer (either key if it's multiple choice or text if you allow it). If you are talking about a grid of responses, then your cross-reference table may have another column with the identifier "category".

0


source







All Articles