Extension talk:Survey

About this board

Timothylegg (talkcontribs)

Hopefully you are reading this before downloading. DO NOT INSTALL THIS. You are wasting your time. It doesn't work with any supported version of MediaWiki.

Reply to "Abandonware junk"

No add/remove question buttons

Mostar18 (talkcontribs)

I've managed to install and I get only the top pane of the EditSurvey page (as in your screen capture), but I get no add/remove question buttons, just SAVE and CANCEL. What could be wrong.

JS console display this warring:

This page is using the deprecated ResourceLoader module "jquery.ui.core". Please use "mediawiki.ui.button" or "oojs-ui" instead.

$egSurveySettings['JSDebug'] = true;

Don't display any additional information.

Survey-REL1_30-55c6b62 , MW1.30 , PHP 7.0.26

Any idea?


Reply to "No add/remove question buttons"

Writable answers doesn't submit

5 (talkcontribs)

I installed this extension on mediawiki 1.21 It does not work if use text-type answers, whatever you write it will be empty in stats (talkcontribs)

Oh sorry that was a mistake (talkcontribs)

Actually I second this. Is there a way to view what a user has typed into the text fields without using the API? (talkcontribs)

I'm seeing the same thing. The input from the survey text-box is placed in the survey_answers table answer_text column correctly and I can view it with a SQL query on the database, but when viewing the statistics of the survey via the Special:SurveyStats article, the results of the text-box answer are not displayed. I tried dropping the table and recreating it with VARCHAR and TEXT data types for answer_text, but that didn't work either. All the other survey answer types display correctly, just not any single or multi-line text box answers.

Here's my config: MediaWiki 1.23.0 PHP 5.5.9-1ubuntu4.3 (apache2handler) MySQL 5.5.38-0ubuntu0.14.04.1

James.henry (talkcontribs)

I suspect that the issue is in the SpecialSurveyStats page in the

protected function getAnswerList( SurveyQuestion $question ) function. I think that the text answers are not evaluating true in this line:     if ( $question->isRestrictiveType() )

The 'else' statement there is to simply return an empty character.

Reply to "Writable answers doesn't submit"

Survey content not loading

S schiffleithner (talkcontribs)

May be, this is the same problem as Extension_talk:Survey#Stuck_Loading_Survey..._After_1.24.0_Update_52886 from Jan. 14 2015:

Fresh install on existing 1.24.1 MediaWiki, installation and update.php seemed to work fine: No error messages, tables created and available. Setting up new surveys seems to work fine, however when trying to take a survey it doesn't show up: "Take a survey" displays edit-options and one line: "Loading survey..." The survey itself doesn't show up.

tested branches:

  • REL1_23 d6ce533
  • REL1_24 c12985a
  • master 8dcdeac

MediaWiki installation:

  • MediaWiki 1.24.1
  • PHP 5.5.10 (cgi-fcgi)
  • MySQL 5.5.40

Any ideas where to dig in?

Vitruvian95 (talkcontribs)

The same here. I installed from git on Mediawiki 1.24.1, PHP 5.4.37, MySQL 5.5.42, and see the survey title but can't add or see questions. Just get the "Loading survey..." message.

Help appreciated.

This post was posted by Vitruvian95, but signed as Felipe95a. (talkcontribs)

Does anyone know if the author of this software is still working on it? I would love to implement this, but it looks like it hasn't been updated since 2011 and it clearly has errors.

Toniher (talkcontribs)

I would dare to say that this might be an incompatibility with Javascript. When using Vector theme in 1.23.x it worked for me, but not with other skins...

Daniel Robbins (talkcontribs)
Reply to "Survey content not loading"

Problem creating surveys

10 (talkcontribs)

I've managed to install and I get only the top pane of the EditSurvey page (as in your screen capture), but I get no add/remove question buttons, just SAVE and CANCEL. What could be wrong.

MW1.17.0 from SVN, PHP 5.3.6

Jeroen De Dauw (talkcontribs)

There most likely is some JavaScript error on your page which is breaking the JavaScript of the survey edit page, which adds this button. (talkcontribs)

How to diagnose? (talkcontribs)

Ok seems to work in Firefox, but not IE - which is a shame as sadly far more people here use IE than Firefox. I wonder if there is a simple fix that would make it more portable?

Moog~mediawikiwiki (talkcontribs)

Interesting. I've just got home and it seems it works in IE9 at home but not IE9 in the office. So it must be something simple. Perhaps there is a test that the page can do and revert to a less advanced display method?

This post was posted by Moog~mediawikiwiki, but signed as Moog.

Jeroen De Dauw (talkcontribs)

I found some "issues" that would cause the JS to break in IE and fixed them in r102761. So if you get trunk, it ought to work. lmk if you need an actual tarball release to test. (talkcontribs)

Yay, that seems to have fixed the form display in IE9. However the Submit button on the TakeSurvey form does not work. It greys out but does not go to the "thank you" form. It seems to work on Firefox though.

Jeroen De Dauw (talkcontribs)

U just made some more JS tweaks which might fix it. If they don't, I need to know where it's going wrong, since I cannot test on IE w/o booting a VM which is to much work to test compat w/ broken browser w/o someone paying me for it :) (talkcontribs)

Yep, that looks like it's done the job. Thank you!! (talkcontribs)

Hi Jeroen,

Apologies, I checked the changes you made to your code. My post was a duplication of the JS file changes.

Thank you for your work the Survey Extension is exactly what I was looking for.

Reply to "Problem creating surveys"

Stuck Loading Survey... After 1.24.0 Update

2 (talkcontribs)

Survey extension was working great prior with Mediawiki 1.23.0, but I'm getting a "Loading Survey...." message at the bottom of any surveys when trying to take the survey after updating to 1.24.0. I dropped the survey tables in the database, deleted the /extensions/Survey/ folder and reinstalled using the git clone, then ran update.php to build new tables. However, I'm still seeing "Loading Survey...." afterwards. Any ideas? Here's my server config:

  • Ubuntu: 14.04 LTS
  • MediaWiki: 1.24.0
  • MySQL: 5.5.38-0ubuntu0.14.04.1
  • PHP: 5.5.9-1ubuntu4.3
Daniel Robbins (talkcontribs)
Reply to "Stuck Loading Survey... After 1.24.0 Update"

Exception with mediawiki 1.22

5 (talkcontribs)

Getting the following error when tying to view the Specials:Survey page:-

[815a4635] /wiki/index.php/Special:Surveys Exception from line 376 of /var/www/wiki/includes/SpecialPage.php: Call to undefined method SpecialSurveys::getPageTitle Backtrace:

  1. 0 /var/www/wiki/extensions/Survey/specials/SpecialSurveys.php(77): SpecialPage->__call(string, array)
  2. 1 /var/www/wiki/extensions/Survey/specials/SpecialSurveys.php(77): SpecialSurveys->getPageTitle()
  3. 2 /var/www/wiki/extensions/Survey/specials/SpecialSurveys.php(54): SpecialSurveys->displayAddNewControl()
  4. 3 /var/www/wiki/extensions/Survey/specials/SpecialSurveys.php(44): SpecialSurveys->displaySurveys()
  5. 4 /var/www/wiki/includes/SpecialPage.php(631): SpecialSurveys->execute(NULL)
  6. 5 /var/www/wiki/includes/SpecialPageFactory.php(488): SpecialPage->run(NULL)
  7. 6 /var/www/wiki/includes/Wiki.php(298): SpecialPageFactory::executePath(Title, RequestContext)
  8. 7 /var/www/wiki/includes/Wiki.php(602): MediaWiki->performRequest()
  9. 8 /var/www/wiki/includes/Wiki.php(467): MediaWiki->main()
  10. 9 /var/www/wiki/index.php(49): MediaWiki->run()
  11. 10 {main}

Any assistance would be greatly appreciated.

Jeroen De Dauw (talkcontribs)

Incompatible MediaWiki version (talkcontribs)

Yea I get the same thing, even though the Requirements section states that Survey requires MediaWiki 1.17 or above, which clearly 1.22 is.

Jack Phoenix (talkcontribs)

getPageTitle() method was introduced in MediaWiki 1.23, which is still under development. Basically the newest version (git HEAD) of Survey requires MediaWiki 1.23 (or newer); try using an older version of the extension with 1.22 (and don't take the Extension: pages as absolute truth; often the documentation is more or less out-of-date, especially for extensions which have no clear "owner"/maintainer). (talkcontribs)

I don't see a REL1_23 in the mediawiki gerrit code review. IS 1_23 just the head?

Reply to "Exception with mediawiki 1.22"

Prevent survey from appearing on all pages

7 (talkcontribs)

Hi Jeroen,

I was wondering if it is possible to prevent the survey from appearing accross all Wiki pages?

We wish to use MediaWiki to provide a Wiki across our international sites. I would like to avoid creating a separate Wiki for each geographical location, we wish to unify our staff with one communication portal. However we would like to publish surveys that are only relevant to each site.

In its current implementation once we publish a survey it appears for all users. I was wondering if it was possible to disable/enable the surveys on specific pages only. In this manner we could direct relevant staff to a particular URL where they wouldbe prompted to complete a survey relevant to them.

Thank you for your work in creating the survey.



Jeroen De Dauw (talkcontribs) (talkcontribs)

Hi Jeroen,

I've tried the newly documented <survey> tag, but it seems not to appear for all users. I've created several dummy accounts and it only appeared for one. I've looked at the code, but I can't work out how the system decides who to show they survey to. I've tried hacking the DB to remove prior submissions, but that does not work. I absolutely need it to be shown to all registered users, ideally with the ability to re-do at any time.

Any pointers apprecieted.

Cheers, Jason.

Jeroen De Dauw (talkcontribs)

A cookie is used to keep track of if you took the survey. Using multiple accounts via the same browser w/o clearing the cache will therefore have that result. (talkcontribs)

Hi Jeroen, I thouoght this was the case, but could not find where it was creating the cookie. Now I realise that the PHP end of things is pretty dumb, with most of the processing being done clientside in JS. I would suggest it would be better to use the logged-in userid in PHP to query the DB for past submissions, rather than relying on cookies. The problem is hotdesking and shared PCs....This means people get requested to complete surveys they've already done if they hotdesk and never get ones others have alreay completed on the same shared PC.

There is also an issue with using a cookie in this way that might explain other problems people are having. When you first visit a survey page the survey is 'completed' by creating a cookie, regardless of if the user actually fills in the form or presses SEND. If their session is aborted for any reason the cookie is created regardless. Which means they never get the request again for a month....

I think the PHP side of things needs to be better. I'll look to see if there is a simple solution, though I've done very little mediawiki programming and even less Javascript...

Cheers, Jason.

Jeroen De Dauw (talkcontribs)

Hitting the db will only help when you require users to login, which is a restriction I do not want to put in the extension. In general the current setup works just fine, but I agree it does not work in your use case. The JS is actually based on what is done on Wikipedia with the banner campaigns.

> When you first visit a survey page the survey is 'completed' by creating a cookie, regardless of if the user actually fills in the form or presses SEND.

Indeed. In some situations you want this, in others you don't. Rather then changing this, I'd introduce another setting. (talkcontribs)

Regarding the note "that using the survey tag is an experimental feature which might not work properly in all situations", I've cloned REL1_22, should I expect this feature to work?

Reply to "Prevent survey from appearing on all pages" (talkcontribs)

I'm testing the extension for use with anonymous reporting of safety issues, so I'd like to allow anonymous users to take the survey as many time as they want.

I've got the anonymous user part, but not the "as many times as they want" part. How can I make that happen? (talkcontribs)
... oh yea, I already tried expiry = 0 and 1. No luck. (talkcontribs)

Also, I want the survey to display on a certain page. It is displaying on the main page even though the <survey> tag only exists on one other page.

Reply to "Multiple submissions"

Survey appear once per user

5 (talkcontribs)

I'd like that the survey appeared only one time per user, when finish the survey, It doesn't appear anymore, is there a way?

Jeroen De Dauw (talkcontribs)

This is the default behavior. If you're having the Survey show using the tag, the user will have a cookie set once they filled it in preventing it from showing again. (talkcontribs)

I let the defaultExpiry with the default value, but the pop-up survey still appears more than one time per user...I tried to overwrite the defaultExpiry value but it didn't work too. Do I have to change other configuration?

Jeroen De Dauw (talkcontribs)

As I states, this ought to be the default behavior. If that's the the case, there likely is a bug somewhere, which you won't be able to fix changing the configuration. You can report the bug on bugzilla

Svenheim (talkcontribs)

But the cookie is not set on submitting the survey. It is already set when the survey is loaded. So you can easily circumvent filling out the survey by just clicking (x) or by refreshing the page and the survey neaver appears again, unless you purge your cookies. This behaviour doesn't make a lot of sense to me. Setting the cookie after submission would be a lot more useful.

Reply to "Survey appear once per user"
Return to "Survey" page.