Hi

it would be great to have easy option to see poll results before voting.
The most often case on other webistes is that you have voting poll and under vote options you have link "see poll results"
and after click on it, vote form is changed by ajax to poll results.
This is great because without this users with permissions to vote, can't see results before they will vote.
And a lot of these users want to see results because they are curious about it, but they don't want to vote (they can be out of poll topic but interested in poll results).
Now these people often vote something only because they want to see poll results.

this option helps to people whose want to see results but they don't want to vote (for now)

do you think that something like this could be added into this module? I think this is really huge improvement for this poll module.

thanks
Igor

Comments

roball’s picture

I don't see sense in this. Once a poll has been closed, users can see the results anyway (without having to "vote nonsense only for being able to see the results"). During an election is going on, eligible voters should NOT see the current results because this may influence their decision. This would cause bad statistics.

igorik’s picture

The sense of this is that not each of eliible voters really wants to vote, or knows for what to vote. But a lot of these eligible voters are curious about poll results.
I think who wants to vote, he will be vote if there is, or there isn't an option to show results before voting.

I think that bad statistics could be more because people who don't know what to vote or they are not target/relevant group for poll question, but they are still curious about poll result, so they have to vote for anything if they want to see poll results.
The best could be if you could turn off this feature (e.g. by permissions) if you will be don't want to use it.

Vector-’s picture

There are two parts to this imo:
- There is already a Results tab, a little AJAXifying of it is all this feature really comes down to
- The other side of things is perhaps the Display results option would be more useful as a node-specific option, rather than a node-type option.
I've added my thoughts on this second part to the relevant feature request: #826214: Add new secret poll type

The bad statistics concern is quite valid for serious decisions, like elections... but those same "bad statistics" feel "fun" in less serious scenarios.

vako’s picture

This is a very important feature that should be considered to be added to this module. Poll results or votes should always be visible to visitors before voting OR it should be an administration option to allow votes to be viewed or not.

There are several issues to be considered:
A) someone needs to vote to see the results - BAD!
B) next day when visiting the site, the initial vote for the same user is expiring, so the same voter needs to vote again to see the results, hence screwing the statistics! - VERY BAD!

Please let the view results before voting be an option to be chosen by the creator of the poll.

miro_dietiker’s picture

I even think an administrator should always be able to see the results independent of the settings or the fact he voted...

vako’s picture

I think he can do so by using the Results tab in Edit mode.

miro_dietiker’s picture

Vako, administrators will see the single votes. Not the result/stats i thought.
Am i wrong?

vako’s picture

StatusFileSize
new23.73 KB

There is the Votes tab that shows individual votes and the Results tab that shows the stats. see attached image.

miro_dietiker’s picture

Vako, i see, but the permission check for this tab seems incredibly broken..

function _advpoll_results_access($node) {
  return strstr($node->type, 'advpoll_') && _advpoll_is_active($node) && $node->votes > 0 && !$node->voted && _advpoll_can_view_results($node);
}
...
function _advpoll_can_view_results($node) {
  $view_results = variable_get('advpoll_view_results_'. $node->type, ADVPOLL_VIEW_RESULTS);
  return (!_advpoll_is_active($node)  // Node is closed
        || ($node->voted && $view_results == 'aftervote') // User voted
        || ($view_results == 'always')); // All can view
}

Well .. i can't find words for those checks...
Hmm well i have finally found one word: Reimplement ;-)

vako’s picture

I agree that it needs a lot of work as any other module, if you are a developer, why don't you contribute and help make it better. We need good programmers in here after all.

miro_dietiker’s picture

Vako, i'm already co-maintainer of this module and most of the fixes done within the last months where commits of me.
I'm just frustrated how everything related advpoll needs complete overhaul.

Looking forward for clean patches from other community participants.

3oheme’s picture

Subscribing. I'd be very useful to have a tab (and a permission ando config too) to see results without voting.

Emmanuel.masanche’s picture

Assigned: Unassigned » Emmanuel.masanche
Priority: Normal » Critical

please help me to have a tab link for showing poll result without voting!I am somehow new to using drupal i really need that!regards!

roball’s picture

Priority: Critical » Normal

This is not a critical issue!

miaoulafrite’s picture

hello there

i'm also interested in displaying results even if user did not vote yet.

this would change the block to:

poll title
poll options
current poll results
vote button

i believe there should be some theming options to achieve this but i don't know which ones

any suggestions are welcome

Zahak’s picture

Priority: Normal » Major

Follow!

Would like to increase the priority as well, as this is required in both current projects and future projects. Also think that this is a very common behavior for a lot of websites today. Of course this should be optional.

I'll see if I get enough time to fix a patch...

Michele Wickham’s picture

I can look at this over the weekend for the d7 branch. My main concern would be allowing it without overriding the current permission structure and behavior. So I could add an additional permission to 'allow results preview' so that admins can turn that on or off on their site depending upon their needs.

thetech249’s picture

Did anybody ever get this figured out?

igorik’s picture

Version: 6.x-1.x-dev » 7.x-3.x-dev
thetech249’s picture

I have 7.x-3.x-dev installed and I still cannot find anything to change the display to show the results before voting.

vemman’s picture

Issue summary: View changes
Issue tags: +poll, +results, +before, +anonymous voting

Is there any update on this?
Has anyone achieved this?
Client wants unlimited voting and results switching with a button (can't convince the DA its stupid)
thanks

Leeteq’s picture

Assigned: Emmanuel.masanche » Unassigned
olli’s picture

Status: Active » Needs review
StatusFileSize
new2.24 KB

Here's a patch that adds 'Show results' button to advpoll form for users with permission to 'preview vote results'.

olli’s picture

StatusFileSize
new2.4 KB
new693 bytes

Added CSS classes 'advpoll-toggle-results' and 'advpoll-toggle-poll' to 'Show results' and 'Show poll' buttons.

vako’s picture

Thank you. Do we need the interdiff.txt file or just the patch file is enough?

vako’s picture

Would it be possible to upload the final advpoll.module file? Cygwin is not patching these files for some reason.

baso’s picture

Issue tags: -

I tested patch #24 by 'olli' for module version 7.x-3.x-dev (2015-Jun-14) and can confirm that it works for my 'normal' Advanced polls. Thanks olli for this nice addition desired by many poll users.

rsavage’s picture

after applying #24 I'm getting

Notice: Undefined index: und in advpoll_get_data() (line 80 of /sites/all/modules/advpoll/includes/advpoll_helper.inc).

dpm shows advpollresults is an empty array.

tripper54’s picture

Status: Needs review » Needs work
natew’s picture

I have started working on a existing site and found the attached patch. It appears to provide the functionality desired. However, it does differ from patch #24. Unfortunately, this isn't my code.

manali_phadke’s picture

#24 works for me. Thanks olli. Now I can see polling results before voting, too.

natew’s picture

Re-spin of #30 for advpoll 7.x-3.0