Mismatched results

Category: Community Polls 8 years ago
We have a simple poll with 4 answers and a custom field.

It is currently showing as 4 voters and 5 votes.

The pie chart shows 50%,25%,25% = 100% so thats ok

the bars showing the results are 40%, 20%,0%,20% = 80% so thats wrong!!

any ideas whats wrong here???
Like it on Facebook, Tweet it or share this topic on other bookmarking websites.
  • Re: Mismatched results

    by » 8 years ago


    Most probably there was something went wrong while updating answers vote count. As I can see 2,1,0,1 - so one vote for the third option is not updated. I am not exactly sure why it happened but it may be some database error or some other system error.

    Can you let me know how many rows inserted into xxx_jcp_votes table and the values?
    votes.png (You do not have access to download this file.)
    pollsetup.png (You do not have access to download this file.)

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    Sociable | Surveys | 
    CjForum | Polls | Answers | Quizzes | Quotes | GPS Tools


  • Re: Mismatched results

    by » 8 years ago


    Hi,

    Screenshot of table data as attached. along with poll setup screen.

  • Re: Mismatched results

    by » 8 years ago


    So the custom answer is what takes one vote. Probably what I thought is wrong on user perspective. I am counting custom answer also as one vote, but since it is not belong to any answer, the answer shows wrong percentage. It is at line 1594 of components/com_communitypolls/models/polls.php
    voters=voters+1, votes=votes+'.count($answers).(!empty($custom_answer) ? '+1':'').', last_voted='.$this->_db->quote($date).'

    should be
    voters=voters+1, votes=votes+'.count($answers).', last_voted='.$this->_db->quote($date).'

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    Sociable | Surveys | 
    CjForum | Polls | Answers | Quizzes | Quotes | GPS Tools


You do not have permissions to reply to this topic.
Powered by CjForum