This is an old revision of the document!
Table of Contents
Polls (pun_poll)
- Status: Under development
- Current version: 1.1
General idea
Allow users to create/vote in polls on a topic creation/viewing page.
Specification
Creation of poll
- User can create poll, when new topic created.
- User should enter question of poll and answers.
- To determine when poll will be finished you can enter a count of days (field “Run poll for (days)”) or a maximum count of votes (field “Votes count”).
- Also there is two options:
- Option that enable seeing of votes results for unvoted users
- Option that allow vote change.
- Poll will not create if
- length of question less than 5 symbols
- length of answer less than 2 symbols
- count of answers less than 2
- user don't enter count of days or maximum count of votes after what poll will be finished.
Viewing of poll
- A poll form is shown if
- a user haven't voted
- a user have voted, but user can change vote.
- Poll results are shown if
- a user haven't voted
- a user have voted, but unvoted user can see results of voting.
Editing of poll
- User can edit poll at edit.php.
- User can reset voting results or remove voting.
- Administrator of Forum can edit or add questions and answers.
Administrator settings
- All admin settings at the “admin/options.php?section=features” page the “Poll settings” part.
- Option that allow change vote for users, that have voted.
- Maximum number of answers.
- Option that allow seeing results for unvoted users.
User groups settings
- For each user group there is parameter that allow to create new voting.
- Guests can't to vote or create new poll.
DB schema
- Table “questions”
- Needed for storing questions and options for poll.
- Fields:
- topic_id (primary key)
- question
- read_unvote_users
- revote
- created
- days_count
- votes_count.
- Table “answers”
- Needed to store answers.
- Fields:
- id (primary key)
- topic_id
- answer.
- Table “voting”
- Needed for storing results of voting.
- Fields:
- id (primary key)
- topic_id
- user_id
- answer_id.
- Field “g_poll_add” was added to table “groups”.
- Keys “p_pun_poll_enable_read”, “p_pun_poll_enable_revote”, “p_pun_poll_max_answers” were added to table “config”.
Development
Trac ticket: #28
Not work:
- button “Submit opinion”
- altering the number of votes in a poll on topic creation
Correct:
- markup/styles
- approve all the messages/text strings
- arrange comments (use your brain and approve translation too)
- name variables
Feature requests
- Add possibility of previewing poll
Please, add your requests here.