This task is to produce the Tally view output for an STV election. Typically this output is used by election admins and scrutinizers to go over the result data to verify it before it is shared with the community (from an earlier conversation with Joe S). Hence we should make this result easy to understand and corroborate for a non-technical community member.
With this understanding, here's the proposed output for the election:
- The results begin with a header for "Elected" which lists of candidates elected in sequential order from first to last. Tied candidates can be represented on the same line.
- Include a line that shows the number of seats to be filled, the number of candidates and the total number of votes.
- The second header shows "Eliminated" candidates.
The droop quota number is included in the header.
- The third header is for "Rounds table" which shows the workings of how we arrived at the results.
- The first column in the table shows the round number we are on.
- The second column indicates how many votes were obtained by each of the candidates in the running, in that round. If there was a transfer of votes from the previous round, that is indicated with a + to show the new votes the candidate received this round. The elected candidate entry is shown in bold and the eliminated candidate is shown with a strike-through.
- Old elected candidates remain bold but are grayed out (#72777d).
- The keep factor is shown in brackets after the transfer calculation
- The calculation numbers need not be in bold
- The third column spells out which candidate(s) were elected and which one(s) were eliminated in that round, or if there were only transfers.
- If no one was elected that line can be omitted. We don't need to show the heading and then the "n/a".
- In the event of a seat remaining unfilled because of eliminations, we can list that seat and say something like: This seat could not be filled because no candidates fulfill the criteria. The last eliminated candidates were: Alice and Bob.
At the end of this task, getHTMLResult() should return the output and that output should be displayed on TallyPage.php when the tally is completed. (Bonus points but you can route getHTMLResult() to getTextResult() as well like HistogramRangeTallier.php does so that it can get output from cli/tally.php)