Change poll summary

https://www.phpbb.com/ideas/
Post Reply
Author:
heinrich_k
Posted:
Thu Mar 21, 2019 8:02 pm
Rating:
Status:
New
Ticket:
PHPBB3-16154
heinrich_k
Registered User
Posts: 201
Joined: Fri Jul 17, 2009 11:40 am

Change poll summary

Post by heinrich_k » Thu Mar 21, 2019 8:02 pm

If a poll allows for a user to select multiple answers the summary should read something like:
%1% votes by %2% users

User avatar
david63
Registered User
Posts: 16417
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Change poll summary

Post by david63 » Thu Mar 21, 2019 10:48 pm

I think that you may need to explain that a bit better because it does not make sense with all those percentage signs
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
AmigoJack
Registered User
Posts: 5606
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Change poll summary

Post by AmigoJack » Fri Mar 22, 2019 7:29 am

Most likely he's (improperly) refering to the sprintf styled language system.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

heinrich_k
Registered User
Posts: 201
Joined: Fri Jul 17, 2009 11:40 am

Re: Change poll summary

Post by heinrich_k » Tue Sep 10, 2019 10:10 am

Yes, %1% means that the first parameter given to the function, %2% is the second and so on.
It is the way the messages in the phpBB language files are defined.

Current Situation
1st person selects 1 option.
2nd person selects 2 options.
3rd person selects 3 options.
Summary tells us, 6 votes were given.

That is correct, but one can't tell if they were given by one user or two or three. So the number of answers given has no meaningful application.
So, the poll summary should be modified to give a proper summery for polls where users are allowed to choose multiple answers.

User avatar
AmigoJack
Registered User
Posts: 5606
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Change poll summary

Post by AmigoJack » Tue Sep 10, 2019 11:23 am

Oh, it's not about placeholders at all. There's just the request to provide more details: currently only the vote amount is displayed, and requested is to also display the amount of users having casted their votes.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
warmweer
Registered User
Posts: 2688
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Change poll summary

Post by warmweer » Wed Sep 11, 2019 2:37 pm

heinrich_k wrote:
Tue Sep 10, 2019 10:10 am
Summary tells us, 6 votes were given.
...
So the number of answers given has no meaningful application.
Perhaps not meaningful to you but a lot of information can be derived from it.

First of all "6 votes were given" is strictly incorrect, a "vote" is the complete submit, and there were only 3 submits, by a maximum of 3 voters.
It would be better to refer to a poll_option, whereas the "vote" is the set of poll_options selected.

Let's see which information could be "missing".
example:
a = 6 x selected
b = 10 x selected
c = 40 x selected

Since a user can only vote for a once (and similar for b and c) we know 6 users votes for a, 10 for b and 40 for c.
We also know a minimum of 40 user have cast their vote (and a maximum of 56), and that maximum 6 users voted for a + b + c (not necessarily a meaningless vote as such), and a maximum of 6 users voted a + b or a + c, whereas a maximum of 10 voters chose b + c.
As mentioned before, the total number of voters is in the range 40-56 (let's say 50 for sake of argument), so if we knew the exact number of voters then we can ascertain that 6 out of 50 selected at least option a, 10 out of 50 selected at least option b and 40 out of 50 selected at least option c >> that gives the percentages you seem to want.

%1% votes by %2% users It's not clear here whether you want absolute numbers or percentages. If it's absolute numbers then both are the same (since each option selected = 1 user). I suspect that what you want is a percentage showing the number of times an option (a, b, c) was selected compared to the total number of options selected but that still doesn't give the number who voted a+b, a+c, b+c or a+b+c (which you didn't request anyway).
So the only thing I see "missing" is the total number of users who have voted.

In the table "phpbb"_poll_votes... the following fields are present: topic_id, poll_option_id, vote_user_id,vote_user_ip
so for a topic_id, count of (group by) vote_user_id gives the total number of voters, something which can probably be done on the fly.
As for calculating (and showing) how many users voted a, b or c only, a+b, a+c, b+c or a+b+c, those queries are a bit heavier and (to me) not worth the extra load. In fact, this is more something for the posts in the poll-topic, where users can then explain (or defend) their choice if they want to.


Added: Oops forgot to mention that I'm in favour of including the number of voters, but am refraining from voting at this time until it's clear what exactly is wanted.
My board's not broken, it just went peculiar

Post Reply

Return to “phpBB Ideas”