Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Questions about POLL Webpart behaviour - how to View modes: 
User avatar
Member
Member
@davey_lad - 9/28/2012 6:21:31 AM
   
Questions about POLL Webpart behaviour - how to
Hi,

I have a few questions relating to the Poll webpart which I can't find the answer to elsewhere on the forums. Can anyone help ?

1. When a poll is closed how do you get it to display the results when the option to "show graph" is unchecked? I have my poll configured so that the graph is only shown AFTER a vote is submitted (show graph:false, show results after vote:true). However, when the poll is closed this just shows the answers but no results.

2. How do you change the "The poll is closed" text? There doesn't seem to be any property available for this. Is this an oversight ? In the source code I notice the following code :

lblInfo.Text = GetString("Polls.Closed");


Where is the value set/stored for "Polls.Closed" ?

3. In CMS Desk where do you analyse/view the results of a poll ?

Any info appreciated.


User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/10/2012 5:37:40 AM
   
RE:Questions about POLL Webpart behaviour - how to
Hello.

1. I tried it on my KCMS 7.0.2 and when having the same setting like you (Show graph: false, Show result after vote: True), the web part displays both questions and results even that the given Poll is already closed. Could you please write also other Poll web part properties and also clarify security settings for given poll?

2. You can change value of this resource string in the <project folder>/CMSResources/CMS.resx file or in the UI cultures in the Site Manager / Development section.

3. In the CMSDesk / Tools / Polls / edit / View section.

Best Regards,
Radek Macalik

User avatar
Member
Member
Accepted solutionAccepted solution
@davey_lad - 10/10/2012 9:35:15 AM
   
RE:Questions about POLL Webpart behaviour - how to
Thanks for the reply. I believe I have found an answer to my problem.. I also beleive the behaviour of Kentico in this respect is incorrect.

Line 393 of CMSModules\Polls\Controls\View\PollView.ascx.cs is shown below :

CreateAnswerSection(forceReload, CheckVoted && PollInfoProvider.HasVoted(pi.PollID));


where the 2nd parameter can affect whether the graph is rendered. However, even if a user HasVoted, if the CheckVoted option is selected on the poll webpart then the graph may never get shown. This is because on Line 582 you have the following condition :

if (ShowGraph || (hasVoted || reload) && ShowResultsAfterVote)
{
// Create graph under the answer
CreateGraph(maxCount, ValidationHelper.GetInteger(row["AnswerCount"], 0), sumCount, index);
}


So, if Show graph is false, and ShowResultsAfterVote is true. The only way the graph is going to get rendered is if (hasVoted || reload) is true -- which isn't the case in my scenario. Also, whether someone has voted or not shouldn't dictate whether they can see the results when the poll is closed.

This probably doesn't make a good deal of sense when reading, however you can see this in action with the following settings and setting the poll to closed :

show graph: false
show result after vote: true
check user voted: false



User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/18/2012 5:48:34 AM
   
RE:Questions about POLL Webpart behaviour - how to
Hello.

I understand your point, so I submitted this as a feature request and we will consider its implementation.

Best Regards,
Radek Macalik