Re: Schema for a survey data collection?
Date: Sat, 21 Jul 2001 23:31:59 GMT
Message-ID: <3B35DCED.B0966161_at_netsetgo.com>
So far, it looks good.
(1) Dynamic inputs, where the options for a question will be determined using
the answer of a previously asked question. e.g. You dont want to present
different choices to the questions based on the sex (m/f) or age-group of the
However, I am curious, how you will provide support for
(2) How will you support branching questions, where certain questions will not be selected based on a prior input.
These can be implemented, but not necessarily in the data modeling level. At some stage, you have to determine what parts of your application are supported by the schema and what parts are supported throuh the application logic.
I can share what I did, it may not necessarily help your situation, but here it is:
I implemented a survey form, not as big as 800 questions but a dozen questions, using XML based representation. The database stores an XML spec for each question in a varchar field. The application interprets the XML to render to the user. Th XML schema might look like this:
<Question>
<Description>What is your country of origin?</Description>
<Type>Int|Decimal(m.n)|String(xx)|Date|Member(a,b,c)</Type>
<Selection>Multi</Selection>
<Interface>Edit|Radio|List|Area</Interface>
<Default>nnnn</Default>
<Source Type="Inline|DB|Custom" />
<Inline>USA,Canada,Mexico,Japan,Germany</Inline>
<DB>Select Country From Country_Table where .. </DB>
<Custom ID=GetCountries />
</Question>
I hope the above XML is self-explanatory. All questions are stored in the
database in this format. However, the survey administrator gets a nice screen to
manipulate all aspects of the question. The custom id of source provides
flexibility to the application programmer to predefine a set of primitives
(stored procedures) to be used as option lists.
The application programmer has to read the question, parse it and prepare the
required HTML to render in the browser. The programmer also has to take care of
the branching questions in the logic.
Received on Sun Jul 22 2001 - 01:31:59 CEST
