Translations of this page: en bg cs de fi fr hu it ja pl ru tr zh

This is an old revision of the document!


Polls (pun_poll)

PunBB 1.3 official extension

  • 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:
    1. Option that enable seeing of votes results for unvoted users
    2. 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:
      1. topic_id (primary key)
      2. question
      3. read_unvote_users
      4. revote
      5. created
      6. days_count
      7. votes_count.
  • Table “answers”
    • Needed to store answers.
    • Fields:
      1. id (primary key)
      2. topic_id
      3. answer.
  • Table “voting”
    • Needed for storing results of voting.
    • Fields:
      1. id (primary key)
      2. topic_id
      3. user_id
      4. 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
  • Add an option to allow to choose more than one answer. Say parameter N is the max number of answers that a user can choose, N=1 being the default.
  • An option to see who voted how. Say, at the results page under each option add a list of users who chose this option.
  • Move all poll-related fields below “Submit” and “Preview” buttons so that when starting a new topic without a poll (which happens much more often than with a poll), user don't have to scroll down for those buttons.
  • The results should include total number of votes (say, as an extra “Total” line in the results table).
  • Add diagrams to polls.
  • Add possibility to create polls with multiple answers.
  • Add possibility to mark topics with polls.

Please, add your requests here.

Screenshots

Viewtopic page


Personal Tools