# How should we implement polls?

**URL:** <https://meta.discourse.org/t/how-should-we-implement-polls/11911>\
**Category:** Feature\
**Created:** [2014 年1 月 13 日 02:48 UTC](https://meta.discourse.org/t/how-should-we-implement-polls/11911 "2014-01-13T02:48:03Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
发布日期： [2014 年1 月 13 日 02:48 UTC](https://meta.discourse.org/t/how-should-we-implement-polls/11911/1 "2014-01-13T02:48:03Z")

</div>

Continuing the discussion from [So, you want to help out with Discourse](https://meta.discourse.org/t/so-you-want-to-help-out-with-discourse/3823/56):

> [@Contributing to Discourse development](https://meta.discourse.org/t/contributing-to-discourse-development/3823/56):
>
> Yes, that sound quite interesting. Are there any specific/unusual functionality it should have beyond the generic web poll option?

Almost all forum software out there supports “polls”. They can be quite fun and allow you to easily gauge what people like / dislike.

@Hunter was asking for some sort of spec of how I would see this work, so here I go.

- Polls should be designed as a standalone plugin. This important cause it ensures our extensibility story is solid and allows us, further down the line, to upgrade poll functionality outside of core releases.

- I think polls should simple be an extension of markdown that only applies on the first post in a topic. Eg:

- Initial implementation should only allow one vote per option.

- Initial implementation should **not** allow for anonymous voting.

- Choices must be locked in after 5 minutes

- On initial render it should not display the results, you must either vote or click on “show results” to see them.

- Initial implementation does not need to worry about randomising options on first view

- Data for the polls should be stored in Topic or Post meta\_data (an hstore column) or in PluginStore, a custom migration in a plugin is a major work to undertake which we can skip for now.

- Controller to receive voting should be registered by the plugin using a rails engine, example is my blog [GitHub - SamSaffron/blog: samsaffron.com blog plugin for Discourse · GitHub](https://github.com/samsaffron/blog)

Questions / ideas?

I would like to keep the first go at this rather simple with minimal features.

---

_[View the full topic](https://meta.discourse.org/t/how-should-we-implement-polls/11911)._
