The Poll content type#
Portal type |
|
Class |
|
Schema |
|
Add permission |
|
Workflow |
|
Allowed content |
Images |
Behaviors |
|
The title is the poll's question, and the description is shown below it.
Voting fieldset#
Field |
Title |
Type |
Default |
Description |
|---|---|---|---|---|
|
Allow anonymous |
Boolean |
|
Lets anonymous visitors vote, when they can see the poll's folder at the moment the poll is opened. |
|
Number of options a voter can pick |
Integer, at least 1 |
|
|
|
Legend |
Text line |
empty |
Shown above the options. When empty, the form shows Select one option or Select up to N options. |
|
Available options |
JSON list |
empty |
The options, see Options. |
|
Shuffle options |
Boolean |
|
Shows the options in a random order to each voter. |
Results fieldset#
Field |
Title |
Type |
Default |
Description |
|---|---|---|---|---|
|
Show partial results |
Boolean |
|
Lets voters see the results while the poll is open, once they voted. |
|
Graph |
Choice |
|
How to draw the results: |
Options#
Each option is stored as an object with an id and a description.
[
{"option_id": 0, "description": "Apple"},
{"option_id": 1, "description": "Banana"}
]
An option that is saved without an
option_idgets the next free id: one more than the highest id in the list, or0for the first.An option keeps its id when the options are reordered or others are removed, so its votes stay with it.
Votes for a removed option are kept, but no longer counted in the results.
Validation#
A poll cannot be saved when any of these rules fails.
It has at least two options.
No two options share an id.
max_choicesis not greater than the number of options.