Extension:SecurePoll/zh

SecurePoll扩展是一个特殊页面扩展，用于选举、投票和调查. 它被用于维基媒体基金会董事会的选举和仲裁委员会的选举，并被用于维基媒体许可证的过渡投票等.

安装
你还需要把新的“ ”用户权限分配给某个用户组. 要把这个权限分配给管理员，请在你的 中添加以下内容.

这允许所有管理员创建投票，但不允许所有管理员管理某个特定的投票（包括编辑投票，查看用户数据等）. 在创建或编辑投票时，可以为某一特定投票定义单独管理员. 只有“ ”组的成员可以管理投票. 要创建这个组，请在你的 中添加以下内容.

然后通过Special:UserRights将一个特定的用户分配到 组. 请注意，选举管理员可以看到选民数据，所以只有受信任的用户应该被分配到这个组. 如果他们被从小组中删除，他们将不再能够管理任何选举.

创建新投票
有两种方法来创建一个新的投票：手动创建一个XML文件并导入，或者使用Special:SecurePoll的投票创建界面.

手动
要手动创建一个投票，需要：


 * 1) 编写一个XML文件
 * 2) 使用 命令行界面命令导入它

在test文件夹中，你可以找到四个示例文件.


 * info
 * info
 * info
 * info

要导入一个投票，从cli文件夹中运行以下内容.

要使用docker导入一个投票，从cli文件夹中运行以下内容：

通过Web界面
A user with the  right can create a new poll via the link at the bottom of Special:SecurePoll.

要创建一个新的投票，请填写创建表格中的必填项. 请特别关注一下字段：


 * When adding poll admins, only members of the  group are allowed. If   is set to , it will be logged whenever an admin is added to or removed from a poll. The logs can be viewed at Special:SecurePollLog.
 * 要创建一个加密的投票，请选择加密方法. 如果你选择GnuPG，会生成一个公钥和一个私钥.  在创建表格中输入加密密钥，并将私人密钥保存在线下的某个地方（一旦选举结束，你将需要它来进行统计）.  A detailed example can be found here.

现在访问Special:SecurePoll，你会看到你的投票.

编辑现有投票
要编辑一个投票，你必须是该特定投票的管理员. From Special:SecurePoll, click on the Edit link for the poll you want to edit.

在选举开始之前，关于选举的任何内容都可以被编辑. 选举开始后，有些字段就不能再编辑了.

编辑可以参与投票的人
要编辑谁可以投票，你必须是该投票的管理员. From Special:SecurePoll, click on the Voter Eligibility link for the poll.

翻译一个投票
要翻译一个投票，你必须是该特定投票的管理员. From Special:SecurePoll, click on the Translate link for the poll you want to translate.

查看投票者名单
任何人都可以看到投票者的名单，除非在创建投票时禁用了透明功能.

某一投票的管理员可以看到投票者的名单，以及可能有助于识别重复投票者的私人信息（例如IP地址、用户代理信息、共享cookies）. If  is set to , it will be logged whenever an admin views private data. The logs can be viewed at Special:SecurePollLog.

管理员可以删除任何他们认为是重复的投票.

计票
要统计一个投票，你必须是该特定投票的管理员. From Special:SecurePoll, click on the Tally link for the poll you want to 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

More information on single transferable votes (STV) can be found here.

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):

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


 * 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:

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

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:
 * Test (STV) elections provide scaffolding from which to tally on