Greetings! :) Coming at you from http://groups.drupal.org/node/201753.

We've had a discussion process opened for a couple of weeks to gain community consensus on how we'd like to run the elections process. This is going to require some technical bits:

Nomination process: Deadline - January 18

1) We need a form to capture nominations ("Nomination" node type) with a few fields on it: Name, Location, Company, "I am willing to travel to in-person board meetings [Y/N]," Who am I? (biography/background), Why I'm running (mission/motivation), Why you should vote for me (qualifications), Election year (automatically filled in). The node submission instructions should note that certain fields will be displayed from the user's drupal.org profile (see fields listed below).

2) These nominations should ONLY be visible to authors when they're initially created. (Default to published = 0)

3) Nominations can be posted (created) by anyone with a drupal.org account. (permission)

4) Nominations need to have comments enabled so that people can ask questions to candidates, or voice support. (Nothing special; just default comments to enabled)

5) Shut off ability to submit nominations on January 26. (permission)

Information and debate: Deadline - January 26

1) Configure a block to display the following information about candidates, drawn from their drupal.org accounts: drupal.org user name, linking to their drupal.org profile page; Job title; Current company or organization; Country. This block should appear in the right sidebar when viewing a candidate's nomination information.

2) Bulk-publish all nomination nodes on January 26 to make them all visible at once. (Nothing special; can just do at admin/content/node)

3) Create a view to display the candidates in a list, with links to their nomination information (nomination nodes).

4) Place for voters asking larger election questions to all candidates. (just use http://groups.drupal.org/drupal-association for that).

Voting process: Deadline - February 2

1) Set up instant run-off voting for the elections themselves using the Decisions module. Draft feature is in #6. It has had next to no testing. status: remaining work is covered below.

2) Create and configure the election as a decision node.
* Open voting as of midnight February 2 UTC.
* Close voting as of midnight February 7 UTC.
* Enter names of all candidates as options.
* Configure to use random ordering of candidates.
status: configured at https://association.drupal.org/node/14638

3) Mass populate the eligible voters table for the given decision with drupal.org user IDs. Voting must be limited to drupal.org accounts with a created date BEFORE January 18, and a login date within the last year. status: webchick and drumm working on this

4) Voting results must not be visible before the end of elections. Ensure that the permission to view vote results is not assigned to any role prior to vote closing. status: some permissions in place but needs testing

5) Add to the voting form a required checkbox affirming: I am eligible to vote as per the published eligibility criteria and I have not voted previously in this election. Proposed implementation: a form_alter() in the custom feature. status: patch posted

6) Address #1030758: Number of rank options one less than number of choices. If not fixed, add instructions that explain workaround--user must assign one candidate the blank option (--) in order to pass validation. status: fixed

7) Monitor voting progress and address any glitches. status: will begin once voting opens

7) Shut off the voting form on February 7 at midnight UTC, to provide final results to the board. status: should be covered by configuration of voting node, above, but needs review at closing time

8) When elections have closed, assign access to the voting results to accounts as per instructions from the elections committee. Individual votes are not accessible via the UI. The decisions module does not itself produce multiple winners of an election--to do so, the elections supervisors will need to manually review vote calculations. status: needs to be done when voting closes.

9) Post vote results on a.d.o and provide to board.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Project: Drupal Association » Drupal Association Project(s)
Issue summary: View changes

Note about anonymous voting.

webchick’s picture

Issue summary: View changes

DeadlinE, not deadlinG. :)

webchick’s picture

Issue summary: View changes

Adding note about voter eligibility.

webchick’s picture

Issue summary: View changes

Updating based on discussions w/ neil.

webchick’s picture

Issue summary: View changes

Adding note about a view.

webchick’s picture

Project: Drupal Association Project(s) » Drupal Association

Advanced Poll

Creating election form

Advanced Poll module creates a new node type called "Ranking Poll" (another one called Binary Poll, but IRV needs ranking):

Ranking poll form has a question (title), description (body), and one or more choices.

On each poll, you can set a number of settings. Here's how I think those should be set:

Advanced poll settings form, which contains settings for number of choices, algorithm, start/end dates, write-in candidates, and voting restrictions

Algorithm: Instant Runoff (as opposed to Borda Count)
Starting / Ending date to open/close the poll on the necessary dates.
Don't allow write-in votes
Yes, restrict voting to an electoral list
No, don't show individual votes

Restricting list of voters

The electoral list can either be a list of individual users, or it can be from a role (note that the role must have "vote on polls" permission to appear in the selection).

Electoral list may be populated by individual user or role.

If a user is not in the electoral list, when they go to the poll, they are told "You are not eligible to vote in this poll." However, confusingly, the options still appear and they're able to go through the motions of adding/ranking candidates, but without the "Vote" button. Hm.

Voting process

Voting works like this:

Add one or more names to the right to vote on them, order them according to preference, submit your vote.

Once you submit the form, normal users get the following:

Just a notice that your vote was captured.

You can optionally let people cancel their votes and vote again ("cancel own vote" permission). Otherwise, the poll on the node simply vanishes.

Administrators, however, can see both the ranked list of winners ("show vote results" permission):

In-process vote results

and the full list of who voted for what. :( ("inspect all votes" permission):

All users and who they voted for, in ranked order.

Validating results

Any users with "show vote results" permission can view the vote results on the poll node. We'll want to turn that permission on for authenticated users after the poll is over.

Decisions module is next...

webchick’s picture

Decisions

Creating election form

Decisions module + Ranking module creates a new node type called "Decisions - ranking", basically identical to the Advanced Poll form:

Ranking poll form has a question (title), description (body), and one or more choices.

On each poll, you can set a number of settings. Most of these are the same, with a few additions in Decision module:

- Another algorithm is Condorcet voting
- You can randomize the choices presented, which is nice.
- There's also an option for requiring a Quorum, either in percent or in number of votes. Not really relevant for this vote, but interesting nonetheless.

Decisions, unlike Advanced Poll, does not allow for write-in candidates, but that is fine for the purposes of this election.

Decisions settings form, which contains settings for number of choices, algorithm, start/end dates, write-in candidates, and voting restrictions

Here's how I think these should be set:
Algorithm: Instant Runoff
Restrict voting to electoral list: checked
Show individual votes: unchecked
Randomize answer order: checked
Date options: Starting / Ending date to open/close the poll on the necessary dates.

Restricting list of voters

The electoral list can only be a list of individual users, one at a time. :\ Also, it's not enough to add them to this list; they also need "vote on decisions" permissions.

Add individual users to the electoral list

If a user is not in the electoral list, when they go to the poll, they are simply told "You do not have permission to vote, or view results of this vote."

Voting process

Voting's not nearly as slick in Decisions module, but here's how it works:

A select box appears under each choice with options '1st', '2nd', '3rd', etc. Set them according to preference, then submit your vote.

If you vote for "2nd" twice, it'll flag an error that you're not allowed.

Once you submit the form, normal users get notice they voted, and also get to see the results:

Shows that Druplicon is in the lead with 100% of votes.

You can optionally let people cancel their votes and vote again ("cancel own vote" permission). Otherwise, the poll on the node simply vanishes.

One great thing about Decisions module is it doesn't show who voted for what, even for user 1. Yay! Of course, the votingapi tables will have the raw results, but I don't think it's possible to get away from that no matter what solution we use. Without it, people could vote multiple times.

So! I think that means we use Decisions module. It seems to meet all the necessary criteria (supports IRV, supports anonymous voting, supports an electoral list).

webchick’s picture

Code:

drush dl decisions
drush dl votingapi
drush en decisions ranking votingapi

Permissions:

Auth:
- Decisions: view decisions, view electoral list, vote on decisions
- Node: Create nomination content, edit own nomination content

Administrator:
- Votingapi: Administer VotingAPI
- Decisions: Administer decisions, Create decisions, Delete decisions, Remove voters

webchick’s picture

Ok, I have a basic thing up and running at http://voting-association.redesign.devdrupal.org/ for demo tomorrow.

(user/pass: drupal/drupal, then log in as test-user / test-user)

Nomination form:
http://voting-association.redesign.devdrupal.org/node/add/nomination

List of nominees:
http://voting-association.redesign.devdrupal.org/nominations

Sample election form:
http://voting-association.redesign.devdrupal.org/node/14246

IMPLEMENTATION NOTES:
- Make sure to uncheck the "Published" flag at http://voting-association.redesign.devdrupal.org/admin/content/node-type... before "real" launch.
- Need a migration path to populate the electoral list; the sample poll does not use one.
- REMOVE access for anonymous users from node/decisions; this is just temporarily in place for beta testing.

webchick’s picture

Ugh. :( What the eff. It's not logging votes. :(

I am out of time to futz with this, sorry. :(

webchick’s picture

Here's an incomplete Feature of what I worked on, though.

Still needs a "Voter" role, filled by a script, and perms attached to it.

webchick’s picture

Project: Drupal Association » Drupal Association Project(s)
Issue summary: View changes

Adding note about voter fraud protection.

nedjo’s picture

Issue summary: View changes

Updated issue summary.

nedjo’s picture

Issue summary: View changes

Updated issue summary.

drumm’s picture

Version: » 6.x-3.x-dev
Component: Elections » Code
Category: task » feature
drumm’s picture

Issue summary: View changes

recording votes needed updatedb

drumm’s picture

From IRC - nedjo: drumm: that content type is ready to go. pls let me know if you have any questions. thx!
Please remember to update the issue queue if no response is in IRC, I could easily have missed that. Updating the issue even with a response is good too.

There were some changes made. I'll see if I can repackage the feature and deploy this evening or tomorrow AM. When is the board meeting tomorrow?

webchick’s picture

Thanks, drumm!

Board meeting is at 11am Pacific.

drumm’s picture

Status: Active » Fixed

I added votingapi 6.x-2.3 and decisions 6.x-1.7 to BZR for deployment.

I committed #6 and then Nedjo's changes:
http://drupal.org/commitlog/commit/31230/6fbd2b4f9f772cac2be39a84095e8cf...
http://drupal.org/commitlog/commit/31230/99cdd64bde9db87c23ccf663814cca9...

webchick’s picture

Status: Fixed » Reviewed & tested by the community

Just a note that I made a few tweaks to the deployed stuff:
- Content type: changed to default to unpublished + unpromoted
- Made some tweaks to the view, specifically one that allows the block to actually work. :)
- Added the block to the right sidebar, visible on node/*
- Changed permissions to post form to auth only, not anon.

I don't have access to re-sync the feature on disk.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed the changes and deploying later today.

nedjo’s picture

@drumm: thanks!

Dries pointed out that https://association.drupal.org/node/add/nomination gives an 'Access denied' when not logged in. Could we present a friendlier error message?

drumm’s picture

I filed #1410880: Friendly 403 pages for 404 pages.

nedjo’s picture

Thanks. Meanwhile I updated the page at https://association.drupal.org/at-large-nominations with text to emphasize the need to log in:

If you decide to run as a candidate, log into this site and nominate yourself
anarcat’s picture

Trying to answer one the questions here:

Does the Decisions module allow for selecting two winners of a run-off election (which we need to do)?

No. There is a single winner from the runoff. I haven't read that code in ages, but quickly glancing over it tells me that the way the winner is chosen is by removing a random *loser* and reassigning his votes if there is a tie in the losers. This is done, until there's a winner, which, in the degenerate case, means that the winner will be chosen randomly on a tie.

According to Wikipedia (I had to dig through the article history to get that for you, see this discussion), that is not the way this is done in Australia or Irland, so obviously this could be improved. For example, "runoff elimination ties can also be settled by counting how many ballots rank each of the two candidates higher, to see which would have won head to head." (Maybe some of those are already implemented in our module too, I am not sure.) Wikipedia *does* say: "The only unarguably fair tie-breaker is to randomly eliminate one of the tied candidates. This rule is always used in a final round when there are only two candidates left."

Those wanting to review that should look at the code here.

nedjo’s picture

FileSize
11.42 KB

@anarcat: thanks for the background and explanation. I'm trying to find time to test and may have more questions.

Attached patch tweaks the view of nominees and adds an "elections admin" role, to be used when the votes are being reviewed. drumm, the tweaks are needed for tomorrow (Jan 30th) if possible to accompany the announcement of candidates. Thanks!

nedjo’s picture

Status: Fixed » Reviewed & tested by the community
FileSize
11.39 KB

/me cringes at setting his own patch to RTBC.

Replacing previous patch--forgot to remove "create nomination content" from authenticated user role, since nominations are closed.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

I deployed this. I opted to remove permissions from features management. I'm not worried about keeping those in code at this time.

webchick’s picture

Just a note that I edited the view to swap out the field it was using for website. However, there will likely be more of these little one-off tweaks over the next week so I wouldn't bother downsycning it for now. Just please don't features-revert. :D

webchick’s picture

Issue summary: View changes

Add details about display of info from drupal.org profiles.

nedjo’s picture

Status: Fixed » Active

There is a lot of outstanding work on the "Voting process: Deadline - February 2" section.

  • The voting feature is almost completely untested.
  • We have an outstanding bug on Decisions: #1030758: Number of rank options one less than number of choices. This will make voting at least confusing.
  • We need to form_alter() the decision node form to add a voter eligibility checkbox.
  • We need to confirm the exact queries to be run to populate a voters list.
  • Assuming this work is completed, there will be a need for pushing live and also doing code-level work on the live server on or before Feb 2.

We currently have no one confirmed to do any of this work. I'm working today on further testing of the voting feature, but have many other elections details to work on. I've tried reaching out for community volunteers but not found any as yet. I could really use help with this work. We need to act fast to avoid postponing the vote and/or potential chaos when voting opens.

nedjo’s picture

Issue summary: View changes

Add details about voting process outstanding tasks.

nedjo’s picture

Issue summary: View changes

Clarify configuration of decision node.

drumm’s picture

I destroyed the elections dev site and created a fresh on in its place. Please use this for testing.

For features, don't do work on both live and dev, one of the two will be overwritten by the other. Let me know if live is in a good condition to be exported so work can happen on dev.

nedjo’s picture

Posted a patch to #1030758: Number of rank options one less than number of choices. Working on form_altering the decisions form to get the required checkbox in.

nedjo’s picture

Issue summary: View changes

Add issue #1030758.

nedjo’s picture

Issue summary: View changes

Update status of remaining tasks for voting system.

webchick’s picture

FileSize
65 bytes

Here's the results of the following query, which pulls in the people eligible to vote in this election:

SELECT uid, name FROM users WHERE status = 1 /* not a spammer */ AND login > 1296626400 /* one year ago */ AND created < 1326866400 /* January 18, 2012 when nominations opened */;
drumm’s picture

https://association.drupal.org/ now has Decisions 6.x-1.8

nedjo’s picture

FileSize
1.48 KB

Patch to add the required checkbox to voting form affirming eligibility.

I haven't limited this to the particular node in question. It's safe enough for now I guess since we're not running any other elections immediately. Thoughts though on how best to limit this? By nid of the decision node?

nedjo’s picture

Issue summary: View changes

Make status strong, not em.

webchick’s picture

Thanks to the magic of Beejeebus, here is a set of update_sql() commands to add the voters list to the table: http://chavez.justinrandell.id.au/gen.php.gz

anarcat’s picture

Ouch! My eyes! ;)

I note that the first voter is "uid, name", maybe we don't want that. ;)

webchick’s picture

FileSize
2.21 MB

SQL to add the electoral list to the table.

drumm’s picture

I committted http://drupalcode.org/project/association_drupalorg.git/commit/ca5c44d to populate the eligible voters on-the-fly using usernames.

drumm’s picture

That is now deployed. I'm loading the electoral list to the live site.

drumm’s picture

273005 eligible voters loaded. NULL was skipped.

webchick’s picture

Status: Active » Fixed

Ok, vote published, announcements promoted, so far it's been beta tested with a few folks from IRC and looks good! Closing this as fixed. *crosses fingers*

I want to really thank Neil Drumm for hopping in here with us at the end and helping us get this done. Thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you!!

kattekrab’s picture

Fantastic work all.

nedjo’s picture

Notes for next time:

Would be good to be able to notify users on d.org that they are eligible to vote. Possible approach:

[Edit: corrected the user name after accidentally posting this with my partner's account--nedjo]

drumm’s picture

We don't do site-wide blocks. That is too shouty and conflicts with full-width pages. An exception is that we have a way to do a red banner at the top, like http://staging.devdrupal.org/ has. This should be used very sparingly, the only use so far has been for the Git launch downtime. Targeted notifications are good.

nedjo’s picture

Status: Fixed » Active

@drumm: thx for clarifications.

In #1430828: Checklist for closing the DA 2012 at large elections I'm thinking we should take a backup of the voting data at the time voting closes (4 PM PST today). Is that feasible? Who might be able to do so?

drumm’s picture

We regularly snapshot the site for dev and staging, and the OSL maintains a backup system. These all eventually get overwritten. A snapshot could be saved somewhere, but where, accessible to who, and for what purpose?

nedjo’s picture

where, accessible to who, and for what purpose?

The purpose is: if there is a need to do a detailed review of election results, we will need access to results as at the close of elections.

As for details, I'm making them up as I go. Offhand (others, please pipe up), I'd suggest a one month period is good--if one month after the elections there has been no issues raised, no need to hold on to data.

As for location and access, the less access the better, so we shd restrict it to a.d.o site admins who already have file/db level access. In the case that the election committee has need of access to the data, we can request it.

If regular backups are retained for a month, no action is needed. If not, it would be great to have a snapshot kept for a one month period.

Thanks!

anarcat’s picture

If I remember correctly, decisions should keep in store the choices the voters made during the election in the decisions_choices table. So unless the database is tampered with (which is an issue even during the election) or the decisions node removed, the results should be kept indefinitely and intact.

drumm’s picture

Status: Active » Fixed

I stashed a copy of association_database_snapshot.staging-165.sql.gz in /var/www/association.drupal.org/ on www*.

decisions_choices is just the choices, the handful of candidates. VotingAPI seems to record the vote data in its tables.

drumm’s picture

Since elections are over, I'm destroying the elections dev site.

webchick’s picture

Sounds good. Thanks, Neil!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Vako’s picture

I am looking for a module that can serve as Nominating people for a special task. This page is the only one I found that has some material, but it's not a module. Can someone help me in this direction please?

tvn’s picture

Issue tags: +da-elections

tag

kattekrab’s picture

Component: Code » association_drupalorg.module
Vako’s picture

Thank you for the links, the Election module did the job for me.

tvn’s picture

Component: association_drupalorg.module » Elections
tvn’s picture

Issue summary: View changes

Update status