Extension:BucketVoting

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.

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
 Put the extension and its files into extensions/BucketVoting within your mediawiki directory. In your LocalSettings.php, add: require_once("$IP/extensions/BucketVoting/BucketVoting.php");

$wgBucketVoting_admingroup="sysop";  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.</li> Run the update.php script in order to create or update the tables used by the extension.</li> </ol>

Creating Polls
Each poll that people can vote on lives on a single page. Special tags are placed that cause the voting components to be displayed.

Tag Reference
These tags are:
 * vote-start : this sets up the poll for voting, including any options that it should have. Options that it takes are:
 * numvotes : the number of votes that the users will be given to spread out amongst the options (default 10)
 * locked : (true/false) whether users can vote in the poll or not


 * vote : puts a voting field on the page for the user to enter the value they'd like. It has one option:
 * key : the key uniquely identifies this vote


 * vote-number : this inserts the number of votes (as set by numvotes) into the text, so you can tell the users about it
 * vote-end : ends the voting form and puts in a submit button.
 * text : the text to put on the submit button


 * vote-admin-summary : 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.

Examples
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: <vote-end /> <vote-admin-summary />
 * Number of votes for the first thing:
 * Number of votes for the second thing:
 * Number of votes for the third thing:

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" />

Other Things

 * The key</tt> value 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-numvotes</tt>.
 * Locked vote values are styled with with CSS class lockedvotes</tt>.

Development
If you want to access the Git repository that this comes from: git clone http://git.catalyst.net.nz/BucketVoting.git or browse it at http://git.catalyst.net.nz/gw?p=BucketVoting.git;a=summary

Credit
This was implemented by Catalyst IT Ltd. on behalf of Land Information New Zealand.