1 of 21

2 of 21

The secret behind POTY’s voting script

Large-scale on-wiki image ballots

3 of 21

This is what you see.

And this is what actually happens.

4 of 21

Machine-assisted voting is required

  • if a high volume of
    • votes
    • voters
    • or candidates is anticipated�
  • if voting must be easy because
    • users from different projects involved
    • users with language-difficulties involved
    • disabled users (dyslexia, …) involved

5 of 21

POTY: number of voters in the final

3390 eligible voters�(Final round) in POTY 2012

6 of 21

POTY: vote count in round 1

130 000 votes

7 of 21

What is POTY’s voting script technically?

  • JavaScript
    • is executed in the visitor’s browser�(not the fastest approach)
    • rich UX, can be edited administrators�(no developer access, code review etc. required)�
  • Makes use of JavaScript libraries
    • most notably jQuery�
  • OpenSource and available under�a free license
    • GPL version 3

8 of 21

Features

  • Eligibility check�
  • Resizing thumbnails�
  • Seeded randomization�
  • User control center�
  • Convenient voting. From different pages.�Press-one-button-and-that’s-it.

[[:commons:Help:EnhancedPOTY.js]]

9 of 21

Basics for the technical stuff

  • API - Application programming interface
    • MediaWiki API can be queried by applications
    • serves machine-readable data
    • serves different formats, e.g. JSON�
  • JSON - JavaScript Object Notation
    • best format for JavaScript application
    • can be converted into an object that can be directly used by JavaScript�
  • Commons API at http://commons.wikimedia.org/w/api.php

10 of 21

Eligibility check

Features

Local eligibility�(Commons)

Eligible

Not locally eligible

Global eligibility�(Commons)

Eligible

Enable ballot buttons

11 of 21

Resize thumbnails

Features

/w/api.php?action=query&prop=imageinfo

<img src=”new image size”>

Browser sends request for new image size

MediaWiki image scaler scales image

<gallery widths=300 ...>

<gallery widths=400 ...>

12 of 21

Seeded randomization

Features

Candidates

Randomization algorithm

Username�(Seed)

13 of 21

14 of 21

Fight the edit-conflict-hell with POTY’s script!

Photo: U.S. Air Force photo/Tech. Sgt. Rey Ramon; PD-US-Gov

15 of 21

16 of 21

Was this all?

It does a lot of other tiny stuff like

  • checking for blocks,
  • comparing user IDs so shared used computers don’t share eligibility,
  • cross-tab communication so one can’t open multiple tabs and evade the vote limit accidentally vote for more media files as allowed,
  • asks IP users to please sign-in, ...

17 of 21

Can I customize it?

  • Custom styles
    • Custom stylesheet possible.�
  • Custom application name
    • “POTY App” isn’t what you want?�
  • Custom translations�
  • Custom functions�
  • None of this documented, yet

18 of 21

Missing but wanted

  • Should work out-of-the-box
    • A wizard helping to prepare and config any image election (also advising which method/setting is most suitable for the intended election)
    • Full support for multiple voting systems (IRV, Schulze method)�
  • Should contain all you need
    • Automated vote checking and result presentation
    • Patrol-bot (automated recent-changes patrolling)

19 of 21

Still don’t know how it works

Points not covered here:�

  • AbuseFilters�
  • Title blacklist�
  • State-transclusion through header

Study the source code or wait until everything is documented.

[[:commons:MediaWiki:EnhancedPOTY.js]]

20 of 21

POTY-Barnstar:�LadyofHats [Public domain]

Banner-Photo:�Llorenzi [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons

LTR:�Logo 1: Binnium [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)]

Logo 2: Mystère Martin [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)]

Logo 3: TMg [CC-BY-SA-3.0-de (http://creativecommons.org/licenses/by-sa/3.0/de/deed.en)]

Logo 4: Peter Southwood [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)]

Logo 5: Pequod76 [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)]

Logo 6: By Lluis Valls [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)]

via Wikimedia Commons

21 of 21

The right tool for your election?

  • Large scale�
  • Clear eligibility criteria, no “anonymous” voting�
  • Comments and communication less important

By smial GFDL 1.2 (http://www.gnu.org/licenses/old-licenses/fdl-1.2.html)], via Wikimedia Commons