Release status: unmaintained
|Implementation||Special page, API, User interface, Ajax|
|Description||Survey is a MediaWiki extension that allows administrators to define surveys that can then be shown to specified groups of users.|
|Author(s)||Jeroen De Dauw|
|Latest version||0.3.0 alpha (2014-04-02)|
|License||GNU General Public License 2.0 or later|
Translate the Survey extension if it is available at translatewiki.net
|Check usage and version matrix.|
Survey is a MediaWiki extension that allows administrators to define surveys that can then be shown to specified groups of users.
- Surveys get displayed to wiki users using a nice pop-up form.
- Surveys can be created and modified via an admin panel (Special:Surveys).
- Surveys can be shown to specific types of users (logged in, anonymous, editor, confirmed, …)
- Surveys can be shown for a specified percentage of users, and only after a certain amount of page views.
- Survey questions can have different types of inputs, of which some allow restricting answers.
- Surveys can be tested by admins via Special:TakeSurvey without them being live on the wiki.
- Summaries of survey submissions can be found on Special:SurveyStats.
- The survey submission data (i.e. user answers) can be exported via an API.
The latest version of Survey requires:
- MediaWiki 1.23+
The extension can be retrieved directly from Git [?]:
- Browse code
- Some extensions have tags for stable releases.
- Browse tags
- Select the tag
- Click "snapshot"
- Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).
- Browse branches
- Select a branch name
- Click "Continue"
Extract the snapshot and place it in the extensions/Survey/ directory of your MediaWiki installation.
If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:
cd extensions/ git clone
Once you have downloaded the code, place the Survey directory within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:
# Survey require_once( "$IP/extensions/Survey/Survey.php" );
The final set is running the MediaWiki setup script update.php, which can be found in the maintenance directory of your MediaWiki install. Via the command line, this is typically done with:
You should NOT modify the settings file, but can have a look at it to get an idea of how to use the settings, in case the below descriptions do not suffice.
Example of how to change a setting:
$egSurveySettings['defaultEnabled'] = true;
|defaultEnabled||boolean||false||If surveys should be enabled by default|
|defaultUserType||Survey::$USER_||Survey::$USER_ALL||The default type of users a survey is shown to|
|defaultNamespaces||array||array()||The default namespaces in which surveys should be shown. Empty list for no namespace restrictions|
|defaultRatio||integer||100||The default percentage of users the surveys should be shown to|
|defaultExpiry||integer||60 * 60 * 24 * 30||The default expiry of cookies used to track survey completion of users, in seconds|
|defaultMinPages||integer||0||The default minimum amount of pages users should visit before getting a survey|
This section is targeted at site admins that want to set up and manage surveys. For users the process of taking a survey should be self-explanatory.
Creating and editing surveys
Surveys can be created, edited and removed in Special:Surveys by people with the survey admin right, by default only sysops.
Surveys can be tested by clicking the survey name or "take this survey" in the admin UI. This takes you to Special:TakeSurvey, which can be used to test survey submissions. You will be able to submit as many times as you want. Only people with the survey admin right can access this page.
Once a survey is enabled, it gets deployed wiki-wide for all users matching the user criterion. These users will then need to visit the minimum amount of pages before the survey gets activated, at which point a lottery is done, making sure only the specified percentage of these users gets the survey.
If you want to instead deploy a survey on one or more individual pages, you can embed the <survey> tag in each one. It is called in the following way:
<survey id="" ratio="" expiry="" min-pages="" />
The ID should match the survey's ID, which is the string that shows up after "Special:TakeSurvey/". The other attributes each correspond to settings found in Special:EditSurvey.
Do note that using the survey tag is an experimental feature which might not work properly in all situations.
Keeping track of surveys
A summary of survey results can be found on Special:SurveyStats, linked from the admin UI. This is only accessible by people with the survey admin right.
Exporting data via the API
Survey allows you to export surveys and submission data via the MediaWiki API using these 3 API modules:
- ApiQuerySurveys — get the surveys matching the provided conditions —
- ApiQuerySurveySubmissions — get the submissions for a survey —
- ApiQuerySurveyAnswers — get the answers (there is 1 for each field in a submission) —
These modules can only be used to query data by people that have the surveyadmin right. Full documentation for these API modules can be found at api.php on your wiki.
Version 0.3.0 alpha is the attempt to bring this extension to compatibility with MediaWiki 1.23+.
The release notes in Git only cover up to version 2.0 at this point.
Survey is fully internationalized. Translation of Survey messages is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.