Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Multiple votes in polls
Avatar
Dietmar Herian
Member
Free Members
sp_UserOfflineSmall Offline
Oct 14, 2012 - 5:48 am

Recently brought up a poll with the ability of multiple votes per voter and recognized that the results chart shows a total of 'number of votes per voter times 100%' - so let's say they have three votes you get a total of 300% in the chart!

For my purposes, I had to normalize it to 100%. I could not find a suitable filter or hook, so I changed it in the plugin directly.

$percent = round(((($answer->answer_votes / $poll->poll_voters)/$poll->poll_votes) * 100));

I added the bold green marked items in sp-polls-components.php. I used $poll->poll_votes instead of $poll_maxanwers to get the real picture even if voters skip some of their votes.

I believe it should be changed to normalized 100% display.

"Computers in the future may weigh no more than 1.5 tons."
(Popular Mechanics, US-Technik-Magazin, 1949)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 14, 2012 - 8:11 am

I can see both sides of this coin...  so will open a ticket on it for consideration - or at minimum, a hook...

Avatar
Dietmar Herian
Member
Free Members
sp_UserOfflineSmall Offline
Oct 14, 2012 - 12:54 pm

Sorry,

I provided wrong code. I must be

$percent = round(($answer->answer_votes /$poll->poll_votes) * 100));

And to be precise -> this is not the full truth, because my testing yielded that $poll->poll_votes is not the real sum of all $answer->answer_votes but a simple multiplication of $poll->poll_voters * $poll->poll_maxanswers meaning that skipped votes are not reducing the total. This way, you get a percentage per answer of the max possible votes, not of the really submitted votes.

I think, rightfully it should be the latter one, but could not find a variable including this information.

Thanks for considering to change.

"Computers in the future may weigh no more than 1.5 tons."
(Popular Mechanics, US-Technik-Magazin, 1949)

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 14, 2012 - 4:15 pm

okay, thanks... ticket open for at least a filter...

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 11, 2012 - 4:05 pm

next version will have a filter that you can custom the percentage calculation for yourself...  still think in most cases, the current calculation is right - want to know % of voters that voted for a choice vice that answer % versus all votes (whether including not selected entries or not)...  but as I said earlier, can see some specific types of polls where that might be what you want...  filter will let you do that...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625