In a discussion titled ‘Poll problem - exact vote numbers needed,’ Silvanus seeks a way to retrieve exact vote counts from polls split across two topics due to a 20-option limit, which distorts percentage calculations. dax suggests adjusting the site setting ‘poll maximum options’ to allow more options per poll, or using the Data Explorer plugin with a custom query. Silvanus notes that voting has already begun, making retaking the poll impractical. gerhard offers a technical workaround: accessing vote data via the Discourse API at https://discourse.example.com/t/#{topic_id}/posts.json, where vote counts are found under the polls key in the JSON response. He also recommends the Data Explorer plugin and references a helpful query. dax later suggests using the Elections plugin for future promotion polls. Finally, Silvanus realizes that clicking ‘Show Results’ reveals total vote counts, allowing manual calculation of individual option votes using percentages and totals — albeit inconveniently. The thread combines technical solutions, plugin recommendations, and a workaround for retrieving exact vote numbers mid-poll.
How can I acquire exact vote numbers in some votings? We are currently voting for trust level 4 people. People have 5 votes. There are 40 candidates, which I had to split into 2 polls because it only accepts 20 per poll. That is, 5 votes split between the two polls. This means that the total of votes differs per poll so the percentages do not correspond.
For exact resolving, I would need to acquire the exact numbers of votes in the polls. How is this done?
There is a site settings for this. 20 is the default value. Search for poll maximum options
To solve your problem I think that you can write a proper query and use the Data Explorer plugin or delete the 2 topics, change the site setting and create only 1 poll with 40 options.
You can find the number of votes with the API. By visiting https://discourse.example.com/t/#{topic_id}/posts.json you’ll get the JSON data of all the posts within the topic. The #{topic_id} is the number you see in your browser’s URL bar when you visit a topic.
The API will return a large JSON object where you’ll find the number of votes for each option under the polls key.
It also seems the number of votes is shown when “Show Results” is clicked… shame Of course this means I have to calculate single option votes manually, but with percentage and total number it’s doable.