Creating and managing polls

:bookmark: This guide explains how to create polls in Discourse to gather votes from users on any topic.

:person_raising_hand: Required user level: All users

:information_source: By default, polls are enabled in Discourse and users of trust level 1 or above are allowed to create them. Site admins can adjust who can create polls via the poll create allowed groups site setting and disable polls using the poll enabled site setting.

Creating a poll from the toolbar

The easiest way to create a poll is to use the poll builder. The poll builder can be accessed from the options menu in the composer, and allows you to make a poll without needing to know the exact syntax.

To show advanced options press the :gear: icon. This will show you different poll options such as if the poll auto closes, set groups allowed to vote, choose bar or pie, etc.

Poll options

Poll type:

  • Single Choice: Default poll type. Users can select a single choice from the poll
  • Multiple Choice: Users can select multiple choices from the poll.
    • The poll creator must also define the minimum and maximum number of choices a user can make. By default the minimum will be 1, and the maximum will be the number of poll choices.
  • Number Rating: Users can select a single number.
    • The poll creator must also define the min, max and step for the number rating. For example, if the min is 2, the max is 10, and the step is 2, the options will be 2, 4, 6, 8, and 10.
  • Ranked Choice: Users rank all options in order of preference. The winner is determined using Instant Run-off Voting — in each round, the candidate with the fewest first-preference votes is eliminated and their votes redistributed, until one candidate achieves a majority or a tie is reached.

Results:

  • Always visible: Default poll results. Users can always see the results of the poll, regardless of if they’ve voted.
  • Only after voting: Users must vote before they can see the results of the poll.
  • When the poll is closed: Poll results will only be revealed once the poll is closed.
  • Staff only: Only site staff will be able to see the poll results.

Allowed groups:

Allows the poll creator to limit which groups can participate in the poll. Users not in the listed groups will be able to view the poll, but not vote. Default is all users can participate, no group limitation.

Chart type:

For Single or Multiple Choice polls, choose whether to display the result in a bar graph or pie chart. Not available for Number Rating or Ranked Choice polls.

Show who voted:

Enabled by default, this allows those who can view poll results to also view the specific choices of each poll user. (Bar Chart type only)

Automatically close poll:

Allows the poll creator to set a date/time for the poll to close automatically. Unlike manually closed polls, auto-closed polls cannot be re-opened.

Allow options to be added or removed after posting (Dynamic):

When enabled, poll options can be added or removed even after the edit window has expired, without clearing votes on unchanged options. This must be set when the poll is first created — an existing poll cannot be converted to dynamic after creation.

Including images

Polls can even include images! After using the poll builder to insert the poll, images can be uploaded to the post and manually added to the poll. Uploaded images should be small, or adjusted to display at a lower percentage:

[poll type=regular]
* ![image|690x458,25%](upload://2u570X7kQiPJQaJD1Bd8MLDHDNB.jpeg)
* ![image|690x334,25%](upload://35fmeFw8RMywSxIc4lbCb8UHPaT.jpg)
* ![image|690x499,25%](upload://xSDkRwmuj1pNc2QXKzthfXRlwsX.jpg)
[/poll]
[poll type=regular]
* Cat: a small domesticated carnivorous mammal with soft fur, a short snout, and retractile claws.
![image|690x458,25%](upload://2u570X7kQiPJQaJD1Bd8MLDHDNB.jpeg)
* Dog: a domesticated carnivorous mammal that typically has a long snout, an acute sense of smell, and a barking, howling, or whining voice.
![image|690x334,25%](upload://35fmeFw8RMywSxIc4lbCb8UHPaT.jpg)
* Fish: a limbless cold-blooded vertebrate animal with gills and fins and living wholly in water.
![image|690x499,25%](upload://xSDkRwmuj1pNc2QXKzthfXRlwsX.jpg)
[/poll]
  • Cat: a small domesticated carnivorous mammal with soft fur, a short snout, and retractile claws.
  • Dog: a domesticated carnivorous mammal that typically has a long snout, an acute sense of smell, and a barking, howling, or whining voice.
  • Fish: a limbless cold-blooded vertebrate animal with gills and fins and living wholly in water.
0 voters

Including relative dates

Polls can also include relative dates! In a similar way to adding images, after using the poll builder to insert the poll you can insert dates into the poll options via the “Insert date / time” composer button:

[poll type=regular]
* [date=2019-10-13 timezone="Europe/Paris"]
* [date=2019-10-12 timezone="Europe/Paris"]
* [date=2019-10-11 timezone="Europe/Paris"]
[/poll]
  • 2019-10-12T22:00:00Z
  • 2019-10-11T22:00:00Z
  • 2019-10-10T22:00:00Z
0 voters

Multiple polls in a post

If multiple polls are used in a single post (like this one!) each poll will need a unique name or they will not work. When using the poll builder each extra poll will be numbered sequentially, but you can also do this manually by adding name="poll_name" as a parameter:

[poll name="poll_1"]
1. option one
2. option two
3. option three
[/poll]

[poll name="poll_3" type=multiple min=2 max=3]
- option one
- option two
- option three
- option four
[/poll]

[poll name="dave" type=number min=2 max=10 step=2]
[/poll]

Manually creating a poll

While the poll builder is the easiest option, it is also possible to manually create and edit polls within the composer itself.

To create a simple poll, surround a markdown list with [poll] and [/poll]:

[poll]
* option one
* option two
* option three
[/poll]

:information_source: Any markdown list will work, including using hyphens - or numbers instead of asterisks *.

This will create the following result:

  1. option one
  2. option two
  3. option three
0 voters

To manually create more complex polls, additional parameters can be added to the poll tag. For instance:

[poll type=multiple results=on_vote min=1 max=2 public=true chartType=pie groups=trust_level_1 close=3024-12-31T00:00:00.000Z]
# Do you like polls?
* Yes
* No
* Maybe
[/poll]
Do you like polls?
  • Yes
  • No
  • Maybe
0 voters

(Though not all options will make sense for all polls :slight_smile:)

Other available poll types include type=ranked_choice for Instant Run-off Voting polls, and the dynamic=true parameter can be added to allow options to be modified after posting.

Using the poll builder is a great way to find out the format of these additional parameters for later use.

FAQs

Can anyone vote in a poll?

Even with no group voting restrictions on the poll itself, users must be able to reply to the topic where the poll is created in order to participate. Users with see only permissions will not be able to vote.

Can polls be edited?

All votes are cleared when a poll is edited, to ensure the poll creator can’t change the choices a user voted for. As such, by default polls can only be edited for a grace period of 5 minutes after being created.

:exclamation: Votes cannot be recovered once a poll is edited and the votes are cleared

An exception to this is dynamic polls (dynamic=true), which allow options to be added or removed after the edit window while preserving votes on existing options.

Can I export poll data for further analysis?

Staff can use the Discourse Data Explorer to export poll data as a csv, which can be imported into the data analysis program of their choice.

Last edited by @hugh 2024-07-29T10:05:00Z

Last checked by @hugh 2024-07-02T09:50:57Z

Check documentPerform check on document:
63개의 좋아요

초보자의 질문일 수 있지만, 궁금한 점이 있습니다.

설문을 생성한 후, 투표가 제출되는 즉시 결과가 보이도록 설정했다고 가정해 보겠습니다. 그런데 실수로, 결과가 투표 종료 후에만 보이도록 설정해야 했다는 것을 깨달았습니다. 그렇다면 현재 설문을 편집하여, 설문 생성 설정에서 기어 아이콘을 통해 접근할 수 있는 옵션 중 결과 가시성을 "항상 표시"에서 "설문 종료 시"로 변경할 수 있는 방법이 있을까요?

아니면, 이 설문을 삭제하고 새 설문을 시작하여 투표 결과 가시성을 "설문 종료 시"로 설정해야 하나요?

스크린샷도 첨부했습니다.

부탁드립니다.

이 게시물이 이 주제에 적합하지 않다면, 관리자에게 적절한 섹션으로 이동해 주시기를 부탁드립니다.

1개의 좋아요

투표를 삭제하지 않고도 변경할 수 있습니다. 게시물을 수정하면 투표가 [poll type=regular results=on_vote public=true chartType=bar]와 같은 형태로 시작됩니다. “results” 매개변수를 results=on_close로 수정할 수 있습니다.
정확히 기억이 나지는 않지만, 투표를 수정하면 모든 투표가 삭제되긴 하지만, 적어도 처음부터 다시 만들 필요는 없습니다.

3개의 좋아요

실제로 그런 경우가 맞습니다.

이처럼 사소한 조정의 경우, '강제’적으로 리셋되는 것보다는 투표를 초기화할 수 있는 옵션이 있는 것이 더 합리적이라고 생각합니다.

과거에는 이러한 유형의 변경 사항에서 수정이 리셋을 트리거하는 것을 피하기 위해 데이터베이스를 직접 수정해 본 적이 있지만, 그 방법은 다소 취약합니다.

4개의 좋아요

많은 도움이 됩니다.

만약 투표 생성자가 투표에 사용된 주제를 편집했을 때, 주제 편집 횟수가 증가하는 대신 감소한다면, 두 분은 무엇을 추론하시겠습니까?

저의 추론은 다음과 같습니다. 기존 투표가 삭제된 후 새로운 투표가 시작되었다는 것입니다. 이는 자신의 표을 던지는 사용자의 관점에서 주제 편집 횟수가 감소하는 현상을 설명해 줍니다.

예시:
사용자는 처음에 투표 설정이 '항상 표시’로 되어 있는 투표에 접근했습니다. 해당 투표의 주제 편집 횟수는 4였습니다.

관리자에게 투표 설정이 '항상 표시’로 되어 있다는 점을 지적받은 후, 사용자는 투표 설정이 '투표 후 표시’로 변경된 투표를 보게 되었습니다. 그러나 주제 편집 횟수는 3으로 줄었습니다. 즉, 주제 편집 횟수가 증가하는 대신 감소한 것입니다.

저는 관리자가 이전 투표를 삭제한 후 새로운 투표를 시작했다고 생각하고 있습니다.

1개의 좋아요

이 문서에 순위 선택 투표(ranked choice polls)에 대한 내용을 추가해 주실 수 있을까요? 구체적으로, 라운드가 어떻게 그리고 언제 증가하는지에 대해 궁금합니다.
감사합니다!

5개의 좋아요

좋은 지적입니다, @meave.

저는 Ranked Choice(순위 선택) 여론조사 관련 글의 저자입니다. 말씀하신 부분은 정말 놓친 부분이네요.

저는 원문(OP)에 대한 수정 권한이 없습니다. 누군가 이 내용을 복사해서 원하는 대로 형식을 잡아주셨으면 좋겠습니다. 혹은 위키로 전환될 경우에도 기꺼이 기여하겠습니다.

현재 시스템은 여기에서 설명된 대로 정확히 작동하며, 전형적인 즉각 결선투표제(Instant Run-off Voting)입니다:

(참고로, 제가 포크한 여론조사 플러그인에는 이 예제가 단위 테스트로 포함되어 있습니다!)

절차는 다음과 같습니다:

모든 유권자는 후보에 대한 순위 목록을 제출합니다. 각 라운드에서는 1위 후보만 고려하며(잠재적 승자와 최악의 패자에 초점을 맞춥니다).

  1. 각 후보의 1위 득표수를 집계합니다.
  2. 가장 많은 표를 얻은 후보를 찾습니다.
  3. 명확한 단독 과반수가 있는지 확인하고, 해당 후보가 있으면 승자로 반환합니다 (더 이상의 라운드는 없으며, 종료).

해당하지 않는 경우:

  1. 가장 적은 표를 얻은 후보를 찾습니다.
  2. 가장 적은 표를 얻은 후보를 모든 표에서 제외합니다.

이제 모든 표가 비어 있는 경우:

  1. 방금 제외된 후보들 간의 동점을 보고합니다 (더 이상의 라운드는 없으며, 종료).

그렇지 않은 경우:

  1. 모든 표의 순위를 위로 올립니다. 특정 유권자의 경우 1위 자리가 패자에게 돌아갔다면, 2위 후보가 해당 유권자의 1위가 됩니다.

이와 같은 라운드가 과반수 또는 동점이 발견될 때까지 계속됩니다.

6개의 좋아요

감사합니다 @merefield!
정확히 제가 필요했던 거였어요!

3개의 좋아요

보고를 위해 다른 채널의 모든 개별 투표 결과를 내보내는 것이 가능한가요?

1개의 좋아요

데이터 탐색기(Data Explorer)를 사용하면 됩니다. AI에게 "데이터 탐색기를 사용하여 보고 목적을 위해 다른 채널의 모든 투표 결과를 내보내는 것이 가능한가"라고 물었고, 다음과 같은 쿼리를 받았습니다:

SELECT  
    p.topic_id, 
    p.name AS poll_name,
    o.id AS option_id, 
    o.html AS option_text, 
    COUNT(v.id) AS vote_count
FROM polls p
JOIN poll_options o ON p.id = o.poll_id
LEFT JOIN poll_votes v ON o.id = v.poll_option_id
GROUP BY p.topic_id, p.name, o.id, o.html
ORDER BY p.topic_id, p.name, o.id;

이렇게 하면 작동할 것 같습니다.

1개의 좋아요

@pfaffman 님, 안녕하세요!

빠른 답변과 도움에 진심으로 감사드립니다.

다음 주에 시도해 볼 계획이지만, 아마도 휴가 이후에야 실제로 테스트해 볼 수 있을 것 같습니다.

테스트가 가능해지면 피드백을 드리겠습니다.

다시 한번 정말 감사드립니다!

1개의 좋아요

안녕하세요, 투표에 대해 질문이 있습니다.

표준 디자인보다 더 보기 좋게 보이도록 HTML이나 CSS를 사용할 수 있을까요?

미리 감사드립니다.

브라우저의 인스펙터에서 시도해 보셨나요? (우클릭 후 검사) 거기서 할 수 있다면 네, 가능합니다.

다만, 투표는 Chart.js를 사용하므로 벡터 기반의 요소가 많습니다.

정말 무엇이 변경하고 싶은지에 따라 다릅니다.

3개의 좋아요

이것은 랭킹 투표입니다. 텍스트가 너무 길 경우, 선택을 위한 버튼은 텍스트의 왼쪽에 위치해야 합니다. 현재 텍스트는 버튼 아래에 있으며, 텍스트를 완전히 오른쪽으로 배치하고 버튼을 왼쪽으로 정렬하여 텍스트와 일치시키기를 원합니다.

여러분 안녕하세요,
설문에 텍스트 입력란을 어떤 식으로든 포함할 수 있는지 아시는 분 계신가요? 예를 들어, 투표자가 왜 특정 옵션을 선택했는지 이유를 설명할 수 있도록 하는 것 말입니다.

1개의 좋아요

“아래에 댓글 달기”?

토픽에 댓글을 남기는 것 외에는 아니에요.

1개의 좋아요

아, 그렇군요. @merefield 님, 감사합니다. 설문 결과와 함께 내보낼 수 있는 서면 피드백을 받으려고 했거든요.

1개의 좋아요


왜 피드가 아닌 클릭 시에만 투표가 표시되나요?

2개의 좋아요

아, 이건 투표/토픽 요약 기능의 한계인 것 같아요. 현재는 메인 토픽 공간 밖에서 이를 표시하는 것이 불가능한 것으로 보입니다.

3개의 좋아요

답변해 주셔서 감사합니다!

3개의 좋아요