part of the ArsDigita Community System
by Philip Greenspun
The Big Idea
We want to be able to survey users. We want a non-technical person to
be able to design surveys from HTML forms. We want someone who is not
a site-admin to be able to review answers (via the module
Division of Labor
A site-wide administrator gets to decide which surveys are enabled or
not enabled. A module admin gets to build surveys (which started off
disabled by default) and edit them. The module admin also gets to
review answers (as above). Module admins are designated by adding them
to the "Simple Survey System Staff" administration group.
Survey Question Possibilities
Each survey question specifies an abstract data type for responses:
Each survey also specifies a presentation type:
- shorttext (less than 4000 characters)
- textarea (size can be specified in
- select (from a fixed set of options in
- radio (from a fixed set of options in
- checkbox (from a fixed set of options in
The data model
We use the following tables:
The philosophy about storing the users responses is to use one single
Oracle table to store all responses, i.e., we do not create a new table
when we create a new survey. In order to make it possible to store all
kinds of data in one table, we give the
survsimp_questions -- questions for each survey
survsimp_surveys -- specs for one survey form (except the questions)
survsimp_responses -- user responses to surveys
survsimp_question_responses -- user responses to
individual questions within a survey
survsimp_question_responses table five columns.
Only one of the columns will be not-null.
-- if the user picked a canned response
choice_id references survsimp_question_choices,
boolean_answer char(1) check(boolean_answer in ('t','f')),
Why the CLOB in addition to the varchar? The CLOB is necessary when
people are using this system for proposal solicitation (people might
type more than 4000 characters).
The user interface for creating a survey is as follows:
- User creates a survey, giving it a name and a description.
- User adds questions one by one, and is given the opportunity to reorder questions.
- To add a question, user first types in the question and selects
its presentation type (radio buttons, checkbox, text field, etc.).
- Then the user is given the opportunity to specify further
attributes for the question depending upon the presentation type that
was chosen. For instance, any "choice" presentation (radio buttons,
checkboxes, and select lists) require a list of choices. A text field
requires the user to specify an abstract data type and the size of the
This module requires no section in /parameters/ad.ini !
This entire system should be superseded by a more glorious one that
Buddy Dennis of UCLA (his PhD apparently isn't helping him get this ACS
module finished) has developed. That's why we call this the "simple"
If Buddy never gets his act together, we should add a feature to this
system whereby a multiple-choice question can solicit a typed-in "Other"
answer as well.