Extension talk:Survey

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Contents

Thread titleRepliesLast modified
Prevent survey from appearing on all pages518:43, 22 November 2011
IE9 Compatibility mode114:15, 14 November 2011
Survey setting: "Users that should get the survey"114:14, 14 November 2011
Caching314:12, 14 November 2011
Problem creating surveys912:29, 14 November 2011
running on PHP version 5.2.12212:28, 4 November 2011

Prevent survey from appearing on all pages

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.

Regards,

John.

john.oriordan12:17, 14 November 2011

See the notes about survey deploy I just added.

Jeroen De Dauw14:30, 14 November 2011

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.

81.105.166.14515:13, 21 November 2011

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.

Jeroen De Dauw16:05, 21 November 2011

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.

81.105.166.14518:06, 21 November 2011

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.

Jeroen De Dauw18:43, 22 November 2011
 
 
 
 
 

IE9 Compatibility mode

SVN:102765 It appears that in IE9, if compatibility mode is enabled, when pressing Submit on a survey form the page just hangs. This does not happen when compatibility mode is turned off.

81.105.166.14514:01, 14 November 2011

Ok. If you have a fix, please provide it. I'm not spending time on debugging such IE issues.

Jeroen De Dauw14:15, 14 November 2011
 

Survey setting: "Users that should get the survey"

The setting "Users that should get the survey" when set to "Authenticated Users" seems to be ignored. Without even logging in I can complete the survey. This means the submission_user_name is set to an IP.

81.105.166.14513:53, 14 November 2011

This setting refers to the survey distribution mechanism, which is wiki-wide and is not relevant when hitting Special:TakeSurvey, which is what I guess you are doing. This special page is meant for testing purposes, not for survey deploy.

Jeroen De Dauw14:14, 14 November 2011
 

Strage one this, perhaps it is intended behaviour?

If I complete the survey as a test user, then edit the questions, the same user get the questionare form but without the corrections. However a new user get the corrected form. It is as though the user's previous form is being cached somehow?

81.105.166.14510:35, 14 November 2011

> If I complete the survey as a test user, then edit the questions, the same user get the questionare form but without the corrections.

I don't get this. Once you complete a survey, you're not supposed to get it again at all. If this is not the case for the normal survey deployment mechanism, it's a bug.

Do note that if modify a survey while it's running, and for example delete a question, it will disappear from the survey for people taking it, but those who already took it, their answer will still be stored, and shown in the results. This is by design (to prevent loss and confusion of data).

Jeroen De Dauw12:42, 14 November 2011

That means I can only test a survey once, repeated tests would fail. Perhaps there should be a configuration, "allow multiple submissions"?

81.105.166.14513:48, 14 November 2011

You can test it via Special:TakeSurvey, if you have the right privileges, as many times as you want.

Jeroen De Dauw14:12, 14 November 2011
 
 
 

Problem creating surveys

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

81.105.166.14517:33, 10 November 2011

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

Jeroen De Dauw17:56, 10 November 2011

How to diagnose?

81.105.166.14518:12, 10 November 2011

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?

81.105.166.14518:18, 10 November 2011

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?

Moog19:37, 10 November 2011

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.

Jeroen De Dauw08:23, 11 November 2011
 
 
 
 
 

running on PHP version 5.2.12

I have Mediawiki 1.17 running on PHP version 5.2.12.

At the moment I see your extension (which would otherwise be perfect for my needs) requires PHP 5.3

Attempting to run it on 5.2 I get the error:

Parse error: syntax error, unexpected T_STATIC, expecting ')' in /home/xxxxxxx/public_html/extensions/Survey/includes/SurveyDBClass.php on line 34

Quite simply, is there a way around this since I don't have the possibility to upgrade PHP yet.

Thanks.

Straitjacket Man12:24, 2 November 2011

The architecture of the Survey extension depends on functionality introduced in PHP 5.3, so I'm afraid it won't work on PHP 5.2.x installs.

Jeroen De Dauw23:52, 2 November 2011

Thanks - I thought that might be the case; guess I'll have to see if I can get PHP upgraded as the Survey is exactly what I need...

87.10.191.6512:28, 4 November 2011
 
 
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox