Survey (Simple)
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
administration directory).
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:
- boolean
- number
- integer
- shorttext (less than 4000 characters)
- text
- choice
Each survey also specifies a presentation type:
- textbox
- textarea (size can be specified in
presentation_options
)
- select (from a fixed set of options in
survsimp_question_choices
)
- radio (from a fixed set of options in
survsimp_question_choices
)
- checkbox (from a fixed set of options in
survsimp_question_choices
)
The data model
We use the following tables:
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
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_question_responses
table five columns.
-- if the user picked a canned response
choice_id references survsimp_question_choices,
boolean_answer char(1) check(boolean_answer in ('t','f')),
clob_answer clob,
number_answer number,
varchar_answer varchar(4000),
Only one of the columns will be not-null.
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).
User Interface
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
input field.
Parameters
This module requires no section in /parameters/ad.ini !
The Future
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"
survey module.
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.
philg@mit.edu