Poll
Poll
by Infiniteinfo, Inc.
Oracle port by Madhu S
The Big Idea
This is a very simple polling module which:
- allows administrators the ability to add, edit, and remove polls as well as
- add, edit, and remove poll choices;
- allows users to respond to a poll question by picking from a list
of available choices;
- allows both users and administrators to view the results of the poll.
Datamodel and Permissions
The datamodel is very simple, consisting basically of the following
tables:
- polls: poll information
- poll_choices: possible answers for a poll
- poll_user_choices: web site visitor answers (or votes)
For simplicity, polls are acs_objects, but poll choices and
votes are not. Also, this package does not create any custom
permissions.
You must have create permission for the package in order to
create a new poll. You must have write permission on a given
poll in order to edit the poll information or add/edit/delete poll
choices. And you must have delete permission in order to
remove a poll.
In practical use, it is envisioned that a group or
user will be granted admin permissions for the package, which
would allow them to fully manage all polls.
Lastly, the package is instance-aware, meaning that each instance
of the polls module contains its own polls.
User Interface
To add a poll:
- Assuming you have the proper permission, go to the poll index page
and click on Add a new poll.
- Name is required and is a short identifier for the poll (eg,
"Club Size").
- Question is also required (eg, "How many members are in your
club?").
- The Start Date and End Date define how long the poll
will run. Leaving the end date blank indicates that the poll will
never expire. Leaving the start date blank indicates that the poll
should start immediately.
- If the Enabled" flag is unchecked, then the poll is
disabled and will never be shown to regular users.
- Setting the Requires Registration flag will only allow
registered site users to answer the poll.
- After saving the poll, you can add poll choices by clicking on
insert a new poll choice.
- Poll choices can be edited, deleted, and re-ordered.
To edit a poll:
- Click on the edit link next to the desired poll.
- Edit the poll information as desired.
- Edit and re-order the poll choices.
- Deleting a poll choice will also delete its corresponding votes,
if any. You will be asked to confirm the deletion.
To remove a poll:
- Click on the delete link next to the desired poll.
- Deleting a poll will also delete its corresponding poll choices
and votes, if any. You will be asked to confirm the deletion.
To take a poll:
- Click on the poll name from the poll index page.
- Select an option (required) and click on Vote
- If Requires Registration is disabled, you will be taken to
the results page which summarizes all the votes to date. Otherwise,
you will be asked to login before your vote will be accepted.
- You can also simply click on the results link without
voting.
- Duplicate votes are currently detected in 2 ways:
- If the user is registered, we log their user_id and
check if they have voted previously.
- We also cookie the user and check for the presence of the
cookie in subsequent votes.
- You cannot vote on a poll which has expired or is disabled.
However, you can always view the results.
ToDo
- Use ad_form instead of the template::form
procedures.
- Move all queries to xql files and port to Oracle.
- Some work would need to be done to have the poll included in any
page, as well as pop up the results in a separate window, as seems to
be common practice in many sites. The voting form and results table
would probably need to be separated as "includes".
- Improve anti-vote-dumping measures.
- Add more detailed reports.