Расширение:SecurePoll

From mediawiki.org
This page is a translated version of the page Extension:SecurePoll and the translation is 35% complete.
Справка по расширениям MediaWiki
SecurePoll
Статус релиза: стабильно
Реализация Служебная страница
Описание Позволяет проводить выборы, опросы и анкетирование
Автор(ы) Tim Starlingобсуждение
Последняя версия 3.0.0 (постоянные обновления)
Политика совместимости Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.25+
Изменения в БД Да
Таблицы securepoll_entity
securepoll_msgs
securepoll_properties
securepoll_elections
securepoll_questions
securepoll_options
securepoll_voters
securepoll_votes
securepoll_strike
securepoll_lists
securepoll_cookie_match
Лицензия GNU General Public License 2.0 или позднее
Скачать
  • $wgSecurePollTempDir
  • $wgSecurePollUseLogging
  • $wgSecurePollKeepPrivateInfoDays
  • $wgSecurePollGpgSignKey
  • $wgSecurePollGPGCommand
  • $wgSecurePollCreateWikiGroups
  • $wgSecurePollSingleTransferableVoteEnabled
  • $wgSecurePollTranslationImportSourceUrl
  • $wgSecurePollUseNamespace
  • $wgSecurePollCreateRemoteScriptPath
  • $wgSecurePollCreateWikiGroupDir
  • $wgSecurePollShowErrorDetail
Ежеквартальные загрузки 28 (Ranked 135th)
Использование общедоступными вики 889 (Ranked 269th)
Переведите расширение SecurePoll, если оно доступно на translatewiki.net
Проблемы Открытые задачи · Сообщить об ошибке

SecurePoll это расширение, позволяющее проводить выборы, опросы и анкетирование. Оно используется для выборов в Совет Фонда Викимедиа, в некоторые Арбитражные комитеты, а также для различных других голосований и опросов в проектах Фонда Викимедиа.

Скриншоты

Установка

  • Скачайте и распакуйте файл(ы) в папку с названием SecurePoll в вашей папке extensions/.
  • Добавьте следующий код в конце вашего файла LocalSettings.php :
    wfLoadExtension( 'SecurePoll' );
    
  • Выполните скрипт обновления, который автоматически создаст необходимые таблицы, используемые расширением.
  • Yes Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.

Вам также нужно будет назначить новое право securepoll-create-poll какой-нибудь группе участников. Чтобы назначить это право администраторам, добавьте следующий код в ваш LocalSettings.php:

$wgGroupPermissions['sysop']['securepoll-create-poll'] = true;

Это позволит всем администраторам создавать новые голосования, но не позволит им управлять никакими конкретными голосованиями (включая редактирование их условий и описания, просмотр данных участников и т.д). Индивидуальные администраторы для конкретного голосования определяются при его создании или редактировании. Только члены группы «electionadmin» могут администрировать голосования. Чтобы создать эту группу, добавьте следующее в ваш LocalSettings.php:

$wgGroupPermissions['electionadmin'] = [];

Затем назначьте определённого участника в группу electionadmin с помощью Special:UserRights. Обратите внимание, что администраторы голосований могут видеть данные голосующих, поэтому в эту группу следует назначать только доверенных участников. Если же исключить участников из этой группы, они больше не смогут администрировать никакие голосования.

Использование

Создание нового голосования

Есть два способа создать новое голосование: вручную создать XML-файл и импортировать его, или использовать интерфейс создания голосований на Special:SecurePoll.

Вручную

Чтобы создать голосование вручную, необходимо:

  1. создать XML-файл
  2. импортировать его, запустив команду import.php в интерфейсе командной строки

В папке test вы можете найти четыре файла с примерами:

  • 3way-test.xml
  • approval-test.xml
  • radio-range.xml
  • schulze-test.xml info

Чтобы импортировать голосование, запустите следующую команду:

extensions/SecurePoll/cli$ php import.php ../test/3way-test.xml

Чтобы импортировать голосование с помощью docker, запустите следующую команду:

docker-compose exec mediawiki php extensions/SecurePoll/cli/import.php extensions/SecurePoll/test/radio-range.xml

Через веб-интерфейс

Участники(цы), имеющие право securepoll-create-poll, могут создавать новые голосования с помощью специальной ссылки внизу страницы Special:SecurePoll.

Чтобы создать новое голосование, заполните обязательные поля в форме создания. Особое внимание может потребоваться при заполнении следующих полей:

  • Только члены группы electionadmin могут добавляться в голосования в качестве администраторов. Если параметр $wgSecurePollUseLogging установлен в значение true, то при добавлении или удалении администратора в голосовании, это будет записываться в специальный журнал. Этот журнал доступен на странице Special:SecurePollLog.
  • To create an encrypted poll, select the radio for the encryption method. If you choose GnuPG, generate a (public) encryption key and a (private) decryption key. Enter the encryption key into the create form, and keep the private key safe somewhere offline (you will need it for tallying, once the election has finished). A detailed example can be seen.

Now visit Special:SecurePoll and you will see your poll.

Edit an existing poll

To edit a poll, you must be an admin of the particular poll. From Special:SecurePoll, click on the Edit link for the poll you want to edit.

Before an election has begun, anything about the election can be edited. After an election has begun, some fields can no longer be edited.

Edit who can vote in a poll

To edit who can vote in a poll, you must be an admin of the particular poll. From Special:SecurePoll, click on the Voter Eligibility link for the poll.

Translate a poll

To translate a poll, you must be an admin of the particular poll. From Special:SecurePoll, click on the Translate link for the poll you want to translate.

See a list of voters

Anyone can see a list of voters, unless transparency features were disabled when the poll was created.

Admins of a particular poll can see a list of voters, along with private information that may help to identify duplicate voters (e.g. IP addresses, user agent information, shared cookies). If $wgSecurePollUseLogging is set to true, it will be logged whenever an admin views private data. The logs can be viewed at Special:SecurePollLog.

Admins may strike any votes that they believe to be duplicates.

Tally a poll

To tally a poll, you must be an admin of the particular poll. From Special:SecurePoll, click on the Tally link for the poll you want to tally.

If the poll has been tallied before, the results will be shown on the page. If not, or if you want to re-tally, there is a form for starting a new tally.

  • If the poll is unencrypted, click on the tally button.
  • If the poll is encrypted, you may need to enter more information. For example, if you used GnuPG, enter the (private) decryption key and click on the tally button. If an encrypted poll has many votes, it may take a long time to tally. You may need to check back later for the results.

Now visit Special:SecurePoll and you will see your poll.

(STV) Tallying

To enable STV tallying please add the below configuration value to LocalSettings.php

$wgSecurePollSingleTransferableVoteEnabled = true;

More information on w:Counting single transferable votes (STV) can be found at Wikipedia.

General algorithm implementation (source).

Quota is + .000001. Quota is the minimum value of votes to secure a seat.

1. Compute the quota.
2. Assign votes to candidates by first preferences.
3. Declare as winners all candidates who received at least the quota.
4. Transfer the excess votes from winners to hopefuls.
5. Repeat steps 3 and 4 until no new candidates are elected. (Under some systems, votes could initially be transferred in this step to prior winners or losers. This might affect the outcome.)
If all seats have winners, the process is complete. Otherwise:
6. Eliminate one or more candidates, typically either the lowest candidate or all candidates whose combined votes are less than the vote of the lowest remaining candidate.
7. Transfer the votes of the losers to remaining hopeful candidates.
8. Repeat 3–7 until all seats are full.

The quota we will use (step 1) is the Droop quota (source):

floor( no. votes / (no. seats + 1) ) + 1

The method for transferring votes from elected or eliminated candidates will be the Meek method:

Tallying (JobRunner)

  • Tallies can be processed via a scheduled job Manual:Job queue. Make sure to create a scheduled job for this task or execute the task manually.
  • Tallies can also be processed by executing the tallying script manually:

To execute a tally, run the following from the cli folder located at extensions/SecurePoll/cli:

extensions/SecurePoll/cli/tally.php

To execute a tally using MediaWiki-Docker, run the following from the cli folder located at extensions/SecurePoll/cli:

docker-compose exec mediawiki php extensions/SecurePoll/cli/tally.php

Generating (STV)Test Elections

  • Test (STV)elections can be generated from the cli folder located at extensions/SecurePoll/cli:
  • To generate a test election, run the following from the cli folder located at extensions/SecurePoll/cli:
extensions/SecurePoll/cli/generateTestElection.php
  • Test (STV) elections provide scaffolding from which to tally on

Documentation

SecurePoll

SecurePoll general documentation can be found at wikitech:SecurePoll.

SecurePoll Improvements

A summary of improvements to SecurePoll can be found at Anti-Harassment Tools/SecurePoll Improvements.

Understanding the STV result