Closed ggordn3r closed 4 years ago
Not quite, I don't think it is related to that. Is there any reason that we would have 13 votes in a round but we only claim to have 12 total? Check out here: https://rankit.skelpo.com/results/P4cL6bavlGkEAKSJJpEJ/summary
I've adjusted it so we don't spit out a negative number but the logic still doesn't make sense to me.
Maybe this is something that @iambateman added to make the rounding work better? Please call/text him to check. Otherwise, I'm not sure what's going on or who would have altered the logic.
People are also reporting that the first vote on a poll seems to be consistently not counted.
Okay, I think I know roughly what the problem is: The vote count is wrong. Can you try this: https://us-central1-rankit-vote.cloudfunctions.net/resync?pollID={POLL_ID} (like: https://us-central1-rankit-vote.cloudfunctions.net/resync?pollID=P4cL6bavlGkEAKSJJpEJ )
Will do two things:
Can you check if that will fix most of our problems here?
Ok, I resynced and it looks better by the end. No negative inactive votes and the count is 13.
However, something odd is still happening. In Round 2 the winner message appears but no one is near the threshold. I thought this was related to the inactive votes, but it must be something else: https://rankit.skelpo.com/results/P4cL6bavlGkEAKSJJpEJ/2
Alright, I have some issue understanding this:
We have winning_percentage
which is what we see there, the 33% as well as it is used to determine the winners of a round. However, this winning_percentage
is defined as 1 / (this.winner_count + 1)
. We have 2 winners, so this is 1/3=0.33=33%
which is correct from a math perspective.
However, the threshold
is at 5. In round 2, "Video chatshas 5 votes, so reached the threshold, but that has seeminlg nothing to do with the
winning_percentage`?
I'm confused was which value is wrong or how they are connected. The message to the right is also incorrect because according to this we cannot find the winner. We know we have a winner but we can't find the winner since the winning_percentage
is not reached.
Now, the reason it is not reached is this: We have 13 votes total but our script adjusted it to 25..
=========
Okay, scrap all that; i just figured out that the adjustment is doing something wrong. So, fixing that and everything looks better now! Check it out. I'm leaving my stuff above though for reference purposes.
This worked. Do you need to resync all polls to propagate the fix?
AUtomatically happening when the result screen is called. :)
See screenshots. I'm assuming this is related to the pull request, which includes this message:
Part of what's returned by the stv function is a field called "eleminated" that contains dictionaries for each eliminated candidate. Each dictionary include the eliminated candidate's name, the round eliminated, and a "from" field that indicates which candidate was eliminated in that round, if there were multiple possible elimination candidates with the same "losing" round total. I wasn't exactly sure how to fill this in for the zero-vote candidates when they are eliminated because I'm not sure how you use this field later on. Right now I fill it with a -1 for zero-vote eliminations. Let me know if my change here messes things up.
Poll URL: https://rankit.skelpo.com/polls/P4cL6bavlGkEAKSJJpEJ