blog

archives

Improved Polls in Discourse

Jeff Atwood August 21, 2015

Polls just got a lot better as of our most recent Discourse 1.3 release! To add a poll to any post, just follow these easy examples:

Single Choice Poll

[poll]
- Apples
- Oranges
- Pears
[/poll]

Multiple Choice Poll

[poll type=multiple]
- Apples
- Oranges
- Pears
[/poll]

Multiple Choice Limited Option Poll

[poll type=multiple min=1 max=2]
- Apples
- Oranges
- Pears
[/poll]

Number Rating Poll

[poll type=number min=1 max=4]
[/poll]

Named Polls

To include several polls in the same post, simply give each poll a name:

[poll name=fruits]
- Apples :apple:
- Oranges :tangerine:
- Pears :pear:
[/poll]

The post owner (or a staff member) can close a poll any time. After the poll is closed (or if you press the Show Results button) you can view the current poll results in graph form:

There are a few other features we want to get to in the future:

  • Show who voted in a poll
  • Auto-close polls after a certain time (or number of votes)
  • Secret polls where results aren’t visible until the poll closes

Try it out in our sandbox and see what you think!

Notable Replies

  1. Caue Rego
    September 2, 2015

    Just awesome!

    I found "named polls" explanation a bit confusing, unless you actually read it. Wouldn't it be simpler to show 2 polls there and call it "multiple polls"?

  2. Patrick
    October 22, 2015

    Great, just one question. Is it possible to make the poll sticky AND only sitcky to those who have not voted ?

  3. cpradio
    December 9, 2015

    Hmm, it works for my API usage, which takes Slack data and pushes it to the forum. What was the input sent to your forum?

    Got a link to it?

    Slack Input:

    Forum Generated this via API

  4. cpradio
    December 9, 2015

    Ah, yeah, you probably don't want HTML output, you likely want to have it send plain text

    [poll name=sharebutton_color]
    - Blue
    - Green
    - Other (add comment below)
    [/poll]

    It would instead push "\n" in replace of the <br> tags, and a space instead of the &nbsp; items.

  5. Markus
    February 2, 2016

    Can I set an extra option to enable to show the voters of each option? For scheduling usage like Doodle.

  6. Erlend Sogge Heggen
    May 24, 2016

    No, but sticky posts can be unstickied by the user, or automatically by reading the entire topic.

Continue the discussion at meta.discourse.org

9 more replies