Page MenuHomePhabricator

Ballot type and voting system should be separated
Open, Needs TriagePublic


Right now, if you pick Schulze method, for instance, you are forced to use a ranked ballot. That should not be the case: you can use Schulze with other types of ballots too (e,g, wutg support/oppose ballots, or with star rating ballots). Same applies to some other choices too.

Moreover, we cannot have a ballot with two questions each of which being tallied in a different way. For instance, you cannot have a multiple choice ranking question that is tallied using Schulze method and a second yes/no quesiton that is aggregated as a percentage alone.

Instead, SecurePoll should give you two separate sets of choices: one for ballot type (support/oppose, star rating, numeric rank, ...), and one for voting system (i.e. how these ballots are combined) which would include Schulze, Meek, etc. Of course some voting systems don't work with some ballot types, and that should be validated in the code. This configuration should not be at the ballot level, but rather, at the ballot question level.

Related Objects

Event Timeline

Huji triaged this task as Lowest priority.


One has seven choices for election type:

NameBallot typeTally type
Approval voteApproval (checkboxes)Plurality (frequency table)
Schulze votePreferential (numeric rank entry)Schzule
Plurality voteChoose (radio buttons)Plurality (frequency table)
Range voting (plurality)RadioRangeComment (radio buttons)Plurality (sum of scores)
Range voting (histogram range)RadioRange (radio buttons)HistogramRange (crosstab)
Range voting (plurality) with commentRadioRange (radio buttons + a comments section)Plurality
Range voting (histogram range) with commentRadioRangeComment (radio buttons + a comments section)HistogramRange

Ballot design for the first three types is consistent: you define questions and for each question you define some answers.

Ballot design for the last four is also consistent, but slightly different the first three: in addition to the questions and answers, you define a minimum and maximum score and a default score.


It appears that there are three ballot types:

  • Choose one ballots, which show radio buttons. This has following sub-types
    • Choose one "named" option: used in current Plurality vote
    • Choose on "numeric" option: used in current Range voting polls
  • Choose many ballots, which show checkbox options:
    • Currently used in Approval vote
  • Enter number ballots, where for each option you enter a number
    • Currently used in Schulze vote

But that is in fact incorrect. There really are only TWO ballot types:

  • Choose one ballot as discussed above
  • Choose many ballot as discussed above

The "enter number" ballot is in fact a variant of the choose one. But instead of showing the numeric options as radio buttons, it shows textboxes in which the number is entered.

Also, Schulze method currently allows an answer to not be ranked at all (and it assumes the worst rank for it by default), while the current choose one implementation makes it mandatory to rank each answer.

Lastly, SecurePoll currently allows ties in choose one ballots (one can give the same score to two answers in Range voting, or the same rank to two answers in Schulze) and does not allow user to control that.

SecurePoll currently supports only some (i.e. not all) of the tally methods that apply to a ballot type.

  • With any choose one ballot, all of the following tally methods can be used:
    • Sum of scores (if the choice is numeric)
    • Schulze (if the choice is numeric)
    • Cross tab
  • With any choose many ballot, all of the following tally methods can be used:
    • Frequency table

To clarify the above discussion, examples of each tally type are shown below.

Frequency table: (twelve people chose Answer One)

Answer One12
Answer Two7
Answer Three0

Sum of scores: (the total score given to Answer One by all voters was 10)

Answer One10
Answer Two7
Answer Three3

Crosstab: (here we assume numeric value for Label 1 is 1, for Label 2 it is 2, etc.)

Label 1Label 2Label 3Label 4Label 5Average Score
Answer 1001454.4
Answer 2323112.5

Scheulze: has its own sophisticated tally, which will remain untouched throughout the revamp. It includes two matrices.


From another perspective, there are two kinds of ballots: those that are two levels deep, and those that are three levels deep.

An example of a two-level ballot is this:

Question 1 - Who should rule the world?

[ ] Option 1 - Micky Mouse
[ ] Option 2 - Mini Mouse

Question 2 - ...

An example of a three-level ballot is this:

Question 1 - How do you like each food item?

          Option 1 = Meh   Option 2 = Okay   Option 3 = Awesome
Item 1          [ ]              [ ]               [ ]
Item 2          [ ]              [ ]               [ ]

Here, for each item, an option is selected.

There are two problems in how SecurePoll currently models this:

  1. SecurePoll interface calls "Micky Mouse" an option. But in the back-end, it is called an "Answer"! You would see a vote entry like Q0000001FA00000020 which means for question 1F the user selected "Answer 20" (hence the prefix 'A')
  2. SecurePoll also calls "Item 1" and "Item 2" options! And to make it worse, internally calls them answers! While they are just sub-questions. Item 1 is not an answer to Question 1. But you will see records like Q0000001B-A0000001D-S+0000000005 which means for question 1B, answer 1D, the value selected was 05.


The Poll type section of the poll creation page should be replaced with two parts: Ballot type and Tally type.

Ballot type will have two radio buttons:

  • Choose one answer for each question
  • Choose many answers for each question

Followed by four checkbox options:

  • Shuffle questions on voting page
  • Shuffle options on the voting page
  • Require that all options be answered
  • Same choice can be selected for multiple items (*new*)
  • Show some options for each answer and allow picking only one (*new*)

Tally type will have four radio buttons:

  • Sum of scores
  • Frequency table
  • Cross tabulation
  • Schulze

If cross tabulation is selected

The following validations will be applied when form is submitted:

  • If "sum of scores" is selected, then:
    • Ballot type must be "choose one"
    • For all answers, a "numeric value" must be provided
    • "Require that all options be answered" must be selected (currently this is not enforced, but if a choice is left unanswered the tallier fails with an error)
  • If "frequency table" is selected, then:
    • No further validation needed
  • If "cross tabulation" is selected, then
    • Ballot type must be "choose one"
    • For all answers, a "numeric value" must be provided
    • "Require that all options be answered" must be selected (currently this is not enforced, but if a choice is left unanswered the tallier fails with an error)
  • If "Shulze" is selected, then:
    • Ballot type must be "choose one"
Huji raised the priority of this task from Lowest to Medium.Sep 15 2017, 7:06 PM
Huji removed Huji as the assignee of this task.May 20 2020, 7:53 PM
Huji raised the priority of this task from Medium to Needs Triage.