Page MenuHomePhabricator

Voting form display for STV polls [M]
Open, Needs TriagePublic

Description

User story

As a voter, I should be able to rank candidates as per my choice in the voting UI for a Single Transferable vote.

Mock
NormalMissing preferences error stateDuplicate preferences error state
image.png (773Γ—450 px, 32 KB)
image.png (900Γ—450 px, 42 KB)
image.png (924Γ—450 px, 42 KB)
Acceptance criteria
  • Different voters should be shown options in different, randomized orders in a dropdown UI. The order of candidates should be consistent throughout the voting form.
    • The order should also be consistent if the form is submitted and the page is reloaded due to an error.
  • Default selected preference is "Select an option". This string is translatable.
  • Voters should be able to sequentially rank the options in their order of preference. For example, a voter can select their first, second and third preference but cannot select their first and third preference only. This would result in an error with the message: Preferences must be selected in sequential order. (See mock for details)
  • No option can be selected twice. If an option is selected twice this should result in an error and the form should not submit. The form data will not be lost. Error message: Options can’t be selected multiple times when ranking.
  • Voters do not need to mandatorily rank all options. They may rank as many candidates as they wish (minimum one).
Note

We'll tackle the disabled options in the dropdowns in a follow-up task.

Event Timeline

ARamirez_WMF renamed this task from Voting form display for STV polls to Voting form display for STV polls [M].May 12 2021, 4:53 PM

Change 690424 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/SecurePoll@master] Add voting form for STV polls

https://gerrit.wikimedia.org/r/690424

Default:

image.png (437Γ—758 px, 82 KB)

(This is OOUI but my setup uses the default dropdown). I didn't know if we had number handling so I did a quick workaround and will look more into it. I just wanted to confirm that the gist of this was ok.

Example error:

image.png (607Γ—785 px, 43 KB)

@Prtksxna could you take a look at these and let me know if they look ok? I used the "candidate" language requested in the task but what do we think about generalizing it to choice like the labels?

I just wanted to confirm that the gist of this was ok.

Yep, this is looking good.

@Prtksxna could you take a look at these and let me know if they look ok?

I've added new mocks for the error states. We don't need the See warnings buttons here. @Tchanders tells me that SecurePoll uses its own error message designs and that we should switch to OOUI at some point. I'll raise a separate task for that.

I used the "candidate" language requested in the task but what do we think about generalizing it to choice like the labels?

Yep, we'll be generalizing them to 'option' and 'preference'. I've updated the language in the ticket and mocks. Let me know if there are other cases which I might have missed.

Change 690424 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Add voting form for STV polls

https://gerrit.wikimedia.org/r/690424

here's what it looks like now:

image.png (455Γ—720 px, 43 KB)

I have performed test my verifying the acceptance criteria. I was able to create a poll with 20 options, one question, and multiple
poll question. Wikisource Version: – (ea98e7e) 06:26, 30 June 2021 GPL-2.0-or-later
Below are some screen shot of the expected error messages:

Screen Shot 2021-06-29 at 6.23.09 PM.png (1Γ—2 px, 340 KB)

Screen Shot 2021-06-29 at 12.35.36 PM.png (1Γ—1 px, 285 KB)

Screen Shot 2021-06-30 at 10.06.14 AM.png (1Γ—2 px, 299 KB)

Making a note here that I am seeing the non-OOUI dropdown on votewiki beta and it awkwardly covers the dropdown box itself. As seen on Chrome and Safari.

If this is a trivial fix, let's fix it.

image.png (1Γ—2 px, 503 KB)