Extension talk:Survey
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| Prevent survey from appearing on all pages | 5 | 18:43, 22 November 2011 |
| IE9 Compatibility mode | 1 | 14:15, 14 November 2011 |
| Survey setting: "Users that should get the survey" | 1 | 14:14, 14 November 2011 |
| Caching | 3 | 14:12, 14 November 2011 |
| Problem creating surveys | 9 | 12:29, 14 November 2011 |
| running on PHP version 5.2.12 | 2 | 12:28, 4 November 2011 |
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.
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.
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.
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.
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.
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.
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.
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?
> 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).
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
There most likely is some JavaScript error on your page which is breaking the JavaScript of the survey edit page, which adds this button.
How to diagnose?
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?
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?
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.
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.