Extension talk:QPoll

Various comments
Has anyone used this? Can someone provide a link to an example? I am looking to add polls to my site but can't decide which extension to use. --Jake4d 13:45, 20 July 2009 (UTC)
 * There's an example link in the infobox, though there's still no example in English (July 2009). I'd place an example in English somewhere, if the site has the extension installed. Here I can provide only source code examples. I've checked them and they were working at my local wiki. You may try to download and install the extension, then create the test page and paste the examples code to it. As of the different polls extensions, you may install all of these to find out which fits your needs better. QuestPC 07:36, 24 July 2009 (UTC)
 * Thanks for pointing me to the Russian example, I will try them all the next time I have a free day. QPoll looks like a nice extension. --Jake4d 17:30, 24 July 2009 (UTC)
 * a percentage bar will be great Vev 15:24, 30 August 2009 (UTC)
 * I've made simple bars in v0.5.0. No time to make something more complex right now. Please check the updated documentation to see how to display these, if you are interested. QuestPC 07:37, 15 September 2009 (UTC)
 * Right now, voting statistics (percents) are available to end-user only in numerical format. The diagrams and bars can only be built by the administrator of the site: One have to export the stats of poll to XLS-file (at Special:PollResults) page, then draw diagrams in Calc or Excel. Maybe someday I'll find the time to add built-in drawing (probably using ploticus), and JS-made bars, perhaps, too. QuestPC 06:49, 31 August 2009 (UTC)
 * Since v0.6.0, it's possible to place separate statistical output (bars, percents) on any user-edited page by using statistical display mode. I hope to extend it to draw diagrams some day. QuestPC 07:57, 28 October 2009 (UTC)
 * Since v0.6.0, it's possible to place separate statistical output (bars, percents) on any user-edited page by using statistical display mode. I hope to extend it to draw diagrams some day. QuestPC 07:57, 28 October 2009 (UTC)

It could be a nice feature to be able to drop polls from the "Special:PollResults" page and actually also from the QPoll-tables in the MySQL database through a tool on the wiki itself. This is useful for the polls that are not used anymore. Cause it seems a bit drastic to use MySQL every time. Do you think this is do-able and how much work would this be? Or is there any other way of cleaning up after old / obsolete polls? Kind regards, -Marco WGA 15:43, 19 February 2011 (UTC)

Versions
I know it says it on the extension page, but just to be clear: this extension does not work with MediaWiki 13.2. --Robinson Weijman 14:00, 25 September 2009 (UTC)

MySQL: "1054: Unknown column 'qp_users.uid' in 'field list' (localhost)"
Hi, I'm running MediaWiki 1.15.1, PHP 5.3.0 (apache2handler) and MySQL 5.1.37 on a local instalation using XAMPP (Apache Friends Edition). The extension installed fine and created the tables. Then I reloaded the special page, as requested. The new page has two links: "List all users" (enabled) and "List all polls" (disabled). I click "List all users" and get a DB error in function "qp_UsersList::getIntervalResults". MySQL returns error "1054: Unknown column 'qp_users.uid' in 'field list' (localhost)". Now, looking at the DB, all QPoll tables were created with the prefix of my wiki. So, there is a "cultiwiki_qp_users" table and it has the uid field. The function "qp_UsersList::getIntervalResults" seems to be ignoring the table prefix. If I remove the "cultiwiki_" prefix from the table name, then the extension complains that some tables are missing, so it expects the table to have a prefix. So, I'm stuck. Any thoughts? Thanks. Hamilton Abreu 22:58, 17 November 2009 (UTC)
 * Hi! I am sorry for delay, I am currently busy with very different job. I've identified the issue. The possible fix is uploaded into SVN. You may download it by using SVN client, or, just by overwritting local file from the direct link: qp_results.php QuestPC 11:24, 19 November 2009 (UTC)
 * Problem fixed. Many thanks. Hamilton Abreu 18:32, 19 November 2009 (UTC)

help?
could I get a bit of help with this extension? I'm just trying to ask a simple question like "what is your favorite character?" and then have a list of ~5 characters where users can choose only one option and then submit it. But i seem to keep running into errors with it, I tried looking at the examples here but there are way beyond anything that I'll need, Thanks redekopmark 18:09, 9 March 2010 (UTC)
 * Please try copy/paste the following code into the page:

 {Choose one of the characters below: What is your favorite character?
 * layout="proposals transpose" type=""}
 * Littlefoot | Cera |  Ducky |  Petrie |  Spike
 * In case that doesn't work, let me know. QuestPC 08:39, 10 March 2010 (UTC)


 * thanks, that worked :) redekopmark 20:47, 11 March 2010 (UTC)

Unable to call qp_Setup
I can get to the special version page and the tables are all setup. I have added the lines in local settings: require_once( "extensions/QPoll/qp_user.php" ); qp_Setup::$cache_control = false; qp_Setup::$global_showresults = 1; qp_Setup::$anon_forwarded_for = true;

I get this error: Unable to call qp_Setup::renderPoll in /var/www/html/mediawiki-1.15.4/includes/parser/Parser.php on line 3243

Can anyone help or know how to correct this?

I am using version: QPoll-trunk-r68481.tar.gz and I have also tested on QPoll_0.6.5.tgz

Thank you,

Nimish Patel
 * Which version of PHP do you use? I cannot reproduce this error with MediaWiki 1.15.4 / PHP 5.2.9-2. If your version is earlier than PHP 5.2.3, callbacks in string form (like "qp_Setup::renderPoll") might not work. I haven't checked an extension with such old PHP builds, so there might be another incompatibilities as well. I've modified the code to pass the callbacks differently in r68762, so try to checkout latest version from SVN, please. QuestPC 06:39, 30 June 2010 (UTC)
 * Apologize for the late response back- I tried the r68762 build from svn and it seemed to work :). I am using PHP version 5.1.6. I'll give and update once I test it some more :) Thanks for your help!! =D

Nimish Patel

LocalSettings changes not working
Hi - I've installed QPoll and confirmed it in SpecialVersion. When I try to add options in LocalSettings.php (i.e. the qp_Setup options) I get this message:  Any idea what is going wrong? We have MediaWiki 1.15.4 (r518) & PHP 5.3.3 (cgi-fcgi) --Robinson Weijman 12:45, 28 September 2010 (UTC)


 * Or are they only for version 0.6.5 (and therefore MediaWiki 1.16? --Robinson Weijman 12:52, 28 September 2010 (UTC)
 * Before 0.6.5, there were global variables $qp_enable_showresults, $qp_AnonForwardedFor used for setup Extension:QPoll. However, v0.6.5 probably should work with MW 1.15.4 too, although I haven't checked this. In case it doesn't, please report a bug on this talk page. QuestPC 16:26, 1 October 2010 (UTC)


 * Good to know, thank you. I'll get back to you about 0.6.5. --Robinson Weijman 13:07, 4 October 2010 (UTC)

Default MW 1.16 download is 0.6.4
Currently the default download for MW 1.16 is 0.6.4 - shouldn't it be 0.6.5? --Robinson Weijman 13:22, 4 October 2010 (UTC)
 * These should be tagged in svn repo. I am currently busy with another projects and still haven't checked v0.6.5 with 1.15.5 and 1.17alpha. I know I should do that, however there is not enough of time for that right now. With 1.16 pre-release it was working, in fact I've used former 1.16 trunk to develop it. Also, with PHP 5.3.x, to make it "look into the future, not the past". QuestPC 05:53, 5 October 2010 (UTC)

New line
I notice that the poll question blocks automatically appear next to each other on the page. I'd like them to appear underneath each other (i.e. like adding a new line character). E.g. in Declaration/voting mode, I'd like the four sections to go underneath each other instead of in a 2 x 2 block. Anyone know how to do that? --Robinson Weijman 15:06, 11 November 2010 (UTC)


 * Solution - I should have seen this: just a question of changing the  value from 2 to 1 (  specifies the number of questions per line). --Robinson Weijman 15:25, 11 November 2010 (UTC)

How do I get an average number score as a result?
I want people to be able to vote on how much they think something is worth, so I want them be able to give any whole number as input and the poll results be an average result of all inputs. I don't want to give people the choice of $1-$1000 or give them $5-$10, $10-$15 kind of price choices either.
 * Such feature has not been implemented yet. As a workaround, you may use current 0.7.0 beta from the trunk. First you have to define text field inputs, then export the complete votes into XLS. After that you may write a macro in your favorite spreadsheet (Calc, Excel) to calculate average values. However, the numeric type of text fields is not checked / not enforced by extension, thus the user may input non-digits into the text field. I'll try to add numeric fields to polls when I'll have some free time. QuestPC 08:48, 18 January 2011 (UTC)

Thanks! I saw that there was a math extension that would let you put a bunch of numbers separated by pipes that would spit out a mean number for you. Is there some kind of form extension (with a phone number or something input field) that could be convinced to use that math extension in its output?
 * The math "extension" is not for calculation, it is being used to render a TeX formula. To calculate in wikitext, you have to install Extension:ParserFunctions. Then, there will be an

parser function available. Of course you can replace constant numbers with nested template calls, including QPoll results retrieval template call: However, there is no results enumerating template, because it might be undesired to provide direct access to another user votes to non-administrators, who edit the pages (usually votes access is restricted to admin-only Special:Pollresults page). That's why I suggest exporting XLS from Special:Pollresults and process it with Libre / OOO Calc macro. QuestPC 07:40, 1 February 2011 (UTC)
 * Speaking of forms, there is simple Extension:Form, which is mostly used to create new pages and such. Also, there are more advanced Extension:Semantic Forms and Extension:Semantic Forms Inputs, but their purposes are different. You may try to use these with latest version of QPoll in trunk (which uses PPframe, thus compatible with embedding of parser functions in tags). But I guess that would really be tricky or even impossible, because semantic has it's own pre / post processing. QuestPC 07:45, 1 February 2011 (UTC)

Layout in Internet Explorer
In Internet Explorer the layout is not pretty: the question numbers appear on the line above where the question itself appears (specifically, above and to the left). Is there a solution for this? --Robinson weijman 09:58, 27 January 2011 (UTC)
 * The question numbers are displayed properly at the same line as the question itself here in IE8. Which version of IE do you use? Also, can you provide the poll source that is supposed to be rendered incorrectly? QuestPC 07:14, 1 February 2011 (UTC)


 * We're obliged to use IE7. =:-(


 * The code (removing sensitive parts) is:

 { What is your general opinion of the wiki? |layout="proposals" type="" showresults="1;color:blue;background:yellow"} ||||| Please rate the following (one response per question) | Very poor | Poor | OK | Good | Very good Search / finding information Accuracy of information Help pages Overall { Your experience |layout="proposals" type="" showresults="1;color:blue;background:yellow"} ||||| Please select one response per question | Strongly disagree | Disagree | Neutral | Agree | Strongly agree The wiki is the first place I look for documentation The information I need can usually be found on the wiki ... a lot more ...


 * I added the nowiki tags so that you can see here how it looks when I'm editing (hope that's clear).


 * Thanks for the prompt response!
 * --Robinson weijman 09:10, 4 February 2011 (UTC)
 * I've tried to fix incorrect position of question number in IE7. Please download trunk version. QuestPC 17:40, 4 February 2011 (UTC)

Thanks. But my poll is already running now. Maybe next time! =:-) --Robinson weijman 14:44, 10 February 2011 (UTC)

Optional question
Is it possible to make a question optional? Specifically, I want to create a single text box at the end of the questionnaire for "other comments". However, this is currently obligatory, which I don't want.

In addition, I am obliged to create a checkbox next to the text field:

{Other feedback |textwidth="60" textheight="4" type="mixed"} || Other comments [ ]<> Type your comments here

Is there a way around that? --Robinson weijman 12:37, 27 January 2011 (UTC)
 * With the latest version (update from trunk) it is possible to have alone text field as the only proposal value. Speaking of transparent category names, that is against the purpose of an extension, but you may try using nbsp as the category name, for example:

{Other feedback <> Type your comments here QuestPC 08:07, 1 February 2011 (UTC)
 * textwidth="60" type="mixed"}
 * &#160;
 * I've made a patch where a question which has a single (and only single) category named as 160 html entity (empty non-breaking space) will not have it's category name displayed. It's in the trunk now. QuestPC 11:25, 1 February 2011 (UTC)


 * Thanks, I will check this out. But what is a transparent category name? --Robinson weijman 09:16, 4 February 2011 (UTC)


 * When I use the suggested code above I get:

Syntax error Other feedback Category name is empty

using MW 1.15.4 and QPoll 0.7.--Robinson weijman 10:12, 4 February 2011 (UTC)
 * The MediaWiki itself renders that as space; however internally that is an entity of code 160: . Also, take a look at the source code of this talk page, you'll see the actual entity in example code. QuestPC 15:31, 4 February 2011 (UTC)

Polls not showing
Hi.

I've installed version 0.7 on MW 1.16.0 on PHP 5.2.6. I tried one of the demo polls: {Your favorite drink [][]<> Winter [][]<> Spring [][]<> Summer [][]<> Autumn but nothing displays except a Vote button. The extension installed okay and in the Poll result special page it is showing: Page "Test" Poll "multi3": Source, Statistics, Users, Not participated I tried 0.6.5 with the same result. Any ideas what I'm doing wrong? Many thanks. mitchelln 13:24, 18th February 2011 (UTC)
 * textwidth="20" type="mixed"}
 * Plain water | Juice | Beer | Other drink
 * Hi, I am running 1.16.0 at my personal wiki and v0.7 works here. I run it with PHP 5.3.3; v5.2.6 is pretty old, however someone was running QPoll 0.6.5 successfully even with really ancient and buggy PHP 5.1.x. So, that sounds strange. Do you have any PHP errors / warnings? Do another parser tag extension run fine? I've noticed that you have poll id mismatch in the source text and at the special page. Perhaps the database is inconsistent. You may try dropping qp_* DB tables and recreate these with Special:Pollresults. However, the current poll data will be lost in such case. QuestPC 19:15, 27 February 2011 (UTC)
 * Hi. Thanks for getting back to me. I dropped and re-created the tables as you suggested and it all started working :) Fantastic extension!
 * mitchelln 10:52, 2nd March 2011 (UTC)

Polls with automatic naming
I was wondering, if and in what way is it possible to give a poll its name automatically. For instance in the case I create a new page and I always want to include the same poll (only for each page I want the poll to have a different name)? Kind regards, -Marco WGA 22:14, 19 February 2011 (UTC)
 * What kind of automatic naming do you need? If you are creating a new page then that page has different title. And different titles can have the same poll id: Title1#mypollid, Title2#mypollid etc. Or, do you want to have automatic poll id naming scheme like this: first poll will have id=id0, second at the same page id=id1 and so on? That would be unreliable in case new poll will be inserted in-between. QuestPC 11:43, 3 March 2011 (UTC)
 * Thank you for your reply! I really like the functionality of your poll. Actually I am looking for a part of both of your answers. Is it possible to automatically give a poll its name based on the page name. I want one poll per page so it would be very convenient to name the poll after its page, hence for page 1: page_name="Page1" then poll_id="Page1", for page 2: page_name="Page2" then poll_id="Page2". In this fashion creating and removing pages does not matter ánd each page will have its unique poll. Possible application: ask users their feedback on every newly created page. Kind regards, -Marco WGA 17:39, 3 March 2011 (UTC)
 * Every poll has the link to the page where it has been defined. So, the page name is already the part of complete poll address. If you define the poll with id=feedback at the page Page1, the complete (full) poll address will be Page1#feedback. You may also define poll id=feedback at the page Page2, it may then be addressed as Page2#feedback. The voting and the statistics of both polls will be separate. If that does not work already, then there is a bug, please let me know. QuestPC 07:45, 4 March 2011 (UTC)
 * Yes you're right I've tested it and it indeed works like that. Furthermore, this approach also works for the "show poll results" part. Thank you! Do you know a trick to automatically include the feedback poll on every page that is newly created? I want to define the feedback questions beforehand and then every new page, created by the users, should automatically have the feedback poll. So I can see what other users think of the newly created page. Kind regards, -Marco WGA 11:14, 4 March 2011 (UTC)
 * Yes, I do. Use Extension:Preloader to define pre-loaded page text, can be anything, including a poll definition. QuestPC 17:42, 5 March 2011 (UTC)
 * Great! :) Thank you, I will try it. Kind regards, -Marco WGA 11:41, 9 March 2011 (UTC)

Vote Button Disabled?
Hi QuestPC. Thanks a lot for writing this Poll system - it's easily the best one available in terms of flexibility. I would like to use this system to allow voting for an election in a non-profit organization I help run. I think I can figure out how to setup the polls in a namespace that only registered users can enter, but before I can do that I'm having a problem: the 'Vote' button is disabled unless I'm logged out - is there a reason for this? Is there a way to enable it for logged in users? (Or, even better, to enable it ONLY for logged-in users?) I'm using PHP 5.2.17 and Mediawiki 1.16.5. Sorry if this is a stupid question. Zelse81 07:12, 19 May 2011 (UTC)
 * Hi Zelse81! Is your poll syntax-errors free? Can you copy/paste it here in &lt;pre&gt; block? Also, which version of QPoll do you use? QuestPC 04:56, 24 May 2011 (UTC)
 * I need to know which version of QPoll is being used and also permissions setup at the wiki (not the whole LocalSettings.php, only permissions part - it can be built-in and / or extension based). QuestPC 05:18, 26 May 2011 (UTC)

Show number of voters?
First of all, thank you for this great extension! I think it would be nice to have the option to show the number of voters for a poll, both in voting and statistical display mode. I know you can find the number of voters at Special:PollResults&id= &action=pulist, but is there any way to show this number somewhere else? Thanks in advance for any ideas.
 * It has to be implemented, currently I do not have enough of free time. However, it should not be too hard - maybe I'll do that next week. QuestPC 05:16, 26 May 2011 (UTC)

Hi, did you have any time to look at this please? Numbers are really useful, currently I have a test poll with one category getting 100% of one vote. Thanks for writing this extension though!

"mixed" attribute
Why does selection of radiobutton not clears out every other category selection in the proposal row? Declaration/voting mode question attribute is "mixed" --Anonim 21:00, 7 September 2011 (UTC)
 * Which version of extension do you use? Clicking radiobutton clears checkboxes and text fields in the same proposal row for me in current trunk 0.8.0a, FF 6.0.2. However, I would not recommend to use it because it is still under development. The changes are large however the release and the updated documentation are postponed due to shortage of time and resources. I hope I will be able to release it someday. QuestPC 13:44, 10 September 2011 (UTC)
 * Здравствуйте Дмитрий! Я использую последнюю размещенную версию - 0.7.0 При смешанном типе атрибутов radiobuttonы выбираются по несколько, причем отменить выбор не получается. Это происходит даже в размещенном вами примере с id=multi2. Браузер FF 6.0.2. И еще очень некрасиво смотрятся цифры 1 перед каждым тестом, если нужно сделать госолование отдельно за каждый. Спасибо за ваш трибьют! Очень приятно видеть здесь соотечественников :)
 * Здравствуйте! Извиняюсь за задержку с ответами, дела. Попробуйте текущую альфа-версию, доступную по данной ссылке: Special:ExtensionDistributor/QPoll . В появившемся меню нужно выбрать "Development version (trunk)" и нажать Continue для скачивания архива. QuestPC 06:48, 15 September 2011 (UTC)

QPoll и поисковики
Заметил, что после вставки голосования некоторые страницы упали в поисковиках. Может ли это быть связано? Может ли код QPoll влиять на продвижение?
 * Поисковики для меня штука достаточно тёмная, я в SEO мало чего понимаю. Думаю что они специально скрывают детали своих алгоритмов, чтобы не было возможности накручивать. Попробуйте сделать голосование на отдельных страницах, ссылки на которые разместите на основных. Но, опять же, я даже и не думаю о поисковиках когда разрабатываю расширение. QuestPC 10:24, 21 September 2011 (UTC)

Fix for MW = 1.17
The current version will not work for MediaWiki version 1.17. This message will be shown: Fatal error: Call to undefined method PollResults::mediawikiversioncompare in \wiki\extensions\QPoll\qp_results.php on line 63 To fix this, change: if ( self::mediaWikiVersionCompare( '1.16' ) ) { wfLoadExtensionMessages( 'QPoll' ); } to wfLoadExtensionMessages( 'QPoll' ); (ie., remove the "if"). --Robinson Weijman 14:39, 6 February 2012 (UTC)

QPoll extension requires Article::doPurge method to be available.
I get this message using QPoll with MW 1.18: QPoll extension requires Article::doPurge method to be available. Your version of MediaWiki is incompatible with this extension. I see that I'm not the only one, but I don't see a fix. What do I need to do? --Robinson Weijman 15:00, 6 February 2012 (UTC)
 * Please try using latest version from trunk, it should work with MW 1.18 and probably even with MW 1.19, after updating DB via "php update.php". However it's still unfinished project and the documentation has not been updated yet. I am off due to financial and family problems but I hope that I'll be able to continue this project soon. QuestPC 05:16, 8 February 2012 (UTC)
 * Thanks very much for the prompt reply. Indeed, that solves the issue. So the conclusion is: do not use the 1.18 version but download the trunk version. (All the best with your current personal situation and hope to see you active here again soon - this is a great extension!). --Robinson Weijman 07:14, 8 February 2012 (UTC)

Clear up / delete out of date polls
Is there any way to remove unwanted polls from Special:PollResults ? --Robinson Weijman 08:17, 9 February 2012 (UTC)
 * Currently there is no way. It's in TODO list. However, I want not to delete them but to move polls into archive instead. That would be more "wiki-way", I think. QuestPC 07:01, 13 February 2012 (UTC)
 * Thanks, QuestPC, I agree about archiving. Good that it is on the to do list. Another option might be to have some kind of test mode, where the results are either not permanently stored or else are stored in a different format, e.g. on a wiki page. --Robinson Weijman 10:48, 14 February 2012 (UTC)