Warning: The code or configuration described here poses a major security risk.
Site administrators: You are advised against using it until this security issue is resolved.
Problem: Vulnerable to Cross-site scripting attacks, because it passes user input directly to the browser. This may lead to user accounts being hijacked, among other things. * Pppery * it has begun 20:29, 1 May 2020 (UTC)
Solution: strictly validate user input and/or apply escaping to all characters that have a special meaning in HTML * Pppery * it has begun 20:29, 1 May 2020 (UTC)
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored.
Release status: unmaintained
|Description||Allows a voting system where the user can distribute an allocated number of votes freely amongst a set of candidates.|
|Author(s)||Robin Sheat (eythiantalk)|
|Latest version||1.0 (2010-03-30)|
|License||GNU General Public License 3.0 or later|
|Check usage and version matrix.|
The bucket voting extension to mediawiki allows people to distribute a number of votes between a number of options, so they can vote based on how important things are to them. This is known as cumulative voting.
The person creating the poll decides how many votes each user will get, which determines how fine-grained the vote allocation can be. Whatever values the users put in will be scaled so they add up to this value (or close to it.)
Hooking it up to Mediawiki
- Download and place the file(s) in a directory called
- Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/BucketVoting/BucketVoting.php"; $wgBucketVoting_admingroup="sysop";
- Run the update script which will automatically create the necessary database tables that this extension needs.
- Optionally, change the value of $wgBucketVoting_admingroup to be another group that you want to be able to see the results of polls. sysop means that only admins will see them.
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Each poll that people can vote on lives on a single page. Special tags are placed that cause the voting components to be displayed.
These tags are:
- this sets up the poll for voting, including any options that it should have. Options that it takes are:
- the number of votes that the users will be given to spread out amongst the options (default 10)
- (true/false) whether users can vote in the poll or not
- puts a voting field on the page for the user to enter the value they'd like. It has one option:
- the key uniquely identifies this vote
- this inserts the number of votes (as set by numvotes) into the text, so you can tell the users about it
- ends the voting form and puts in a submit button.
- the text to put on the submit button
- adds a form that only the admin can see that contains summaries of all the votes on this page, and lets the admin remove all votes from any of the items.
The following is a sample page, showing how the tags go together:
Voting Page <vote-start numvotes="100" /> You have <vote-number /> votes to spread among the items below: * Number of votes for the first thing: <vote key="first" /> * Number of votes for the second thing: <vote key="second" /> * Number of votes for the third thing: <vote key="third" /> <vote-end /> <vote-admin-summary />
Once the voting is over, you may want to leave the page as-is, but prevent people from changing their votes. To do this, make your start tag:
<vote-start numvotes="100" locked="true" />
keyvalue is what links the vote and the value in the admin screen. Changing this is like creating a new vote.
- The votes that the user assigns are scaled to fit in the range of 0-
- Locked vote values are styled with with CSS class
If you want to access the Git repository that this comes from:
git clone https://github.com/catalyst/bucketvoting.git
or browse it at https://github.com/catalyst/bucketvoting