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:
<poll>
- This is the first option
- This is the second option
- This is the third option
</poll>
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.
Thanks, I was thinking something along those lines, but would have missed a few details e.x. [quote=“sam, post:1, topic:11911”]
Choices must be locked in after 5 minutes
[/quote]
I’m looking through the existing code right now, but will probably have to wait till tomorrow to get started on actual implementation.
I was thinking extra UI in the editor, with the traditional “enter each option in its own textbox” and some options (choose one/choose many), and the actual poll being inserted right underneath the topic map.
I agree with @sam, this is not a good idea. Use markup instead, otherwise it is going to be hellaciously complicated, and you will also end up with terrible UI to boot.
I also suggest starting the topic title with Poll: triggers this markup behavior. The first list you find in the first post, that is the poll choices, provided the title starts with “Poll:” (case insensitive).
Throw an error if you start the topic with poll: but do not have a list in it anywhere.
On a UI note, it would be great to see poll results displayed as a responsive pie chart rather than the traditional drudgery of static horizontal bars.
I think the stack bar chart suffers from exactly the main criticism you cite for pie charts. Its hard to tell the relative size of two pieces.
A simple bar chart as proposed does not suffer from this, and seems like the most sensible first option to provide.
Additional views of the data as options would all be nice of course, then you can choose a pie chart, a stackbar chart, or the next thing someone comes up with if you like it better.
I always thought it would be pretty neat to more than one poll per topic. Use case would be for long running threads, like one about politics. The first post would then link to the post with each poll.
If there’s are criticsm it has to be a different one. When comparing stacks in the stacked bar graph, you’re really comparing lengths and not areas (since the width is constant), and you have a linear relationship between the results and the areas.
In the case of the pie, you’re actually comparing areas (or more precisely angles). You still have a linear relationship between angles and results, but humain brain suck at comparing angles.
Basically we can compare lengths but not much more
I don’t see how several bars solve the problem of comparing non-adjacent parts. You’ll always get non-adjacent bars, afaict.
As for the pencil example, it doesn’t really map to our problem.
I believe that we need to both be able to compare any answer with any other answer AND any answer with the sum of all the answers (that is comparing 23% and 45% AND comparing 17% to 100%).
In the case of unstacked bars (not sure if there’s a name for this), one cannot compare a single answer with 100% so you end up in situations where for example you have 8 answers w/ 10% votes, 1 with 0% and 1 with 20%. All of a sudden, the 20% bar seems huge compared to the others and you may think that you’ve find a clear consensus, when you haven’t.
But the facebook example @techAPJ posted above , with each bar shown within a 100% bar solves that.
In any case, as far as the first, out-of-the-box visualization goes, I don’t see any reason to do anything more complicated or contentious than a traditional bar chart, along the lines of what @codinghorror and @techAPJ pasted above.
After that, folks can add more of the fancier options fueled by debates like these
I agree with this as the initial implementation, but would like to see being able to choose multiple options later (a feature that likely doesn’t get a lot of usage; but there are times it is needed).
I also liked the cleanliness of the markup you provided, I could easily see that being a good solution to how to create one.