Poll
When building a poll you can add:
- Poll questions:
SingleChoice
andMultipleChoice
- Form fields
- General blocks
- One result page
Single/multiple choice questions
Properties
SingleChoice
and MultipleChoice
questions work in the same way - a new item gets added to build.blocks
, consisting of:
Property | Required | Type | Description | Default |
---|---|---|---|---|
title | ✓ | string | The question | |
type | ✓ | string | set to SingleChoice or MultipleChoice | |
items | ✓ | string[] | An array of possible choices | |
itemsShuffled | boolean | If set to true , the order of the items/choices will be shuffled | false | |
required | boolean | If set to false , the user can skip the question | true |
Example object
{
"title": "The best noodles?",
"type": "SingleChoice",
"items": [
"Spaghetti",
"Fusilli"
]
}
Here the difference between SingleChoice
and MultipleChoice
is that with SingleChoice
the user can only select one answer, while with MultipleChoice
the user can select multiple answers. Apart from that, they are the same for the build configuration.
Result page
In a poll only one result page is allowed which is specified in build.result
. Basic results have a title
and description
property.
Example in build.result
:
{
"title": "Thank you!",
"description": "We are happy to have you here"
}
If you want to create complex result pages with texts, images, answered blocks, ... click here to learn how to build advanced result pages.
Full example
{
"title": "What's your favorite color?",
"type": "Poll",
"blocks": [
{
"title": "What's your favorite color?",
"type": "SingleChoice",
"items": [
"Red",
"Blue",
"Green",
"Yellow"
]
},
{
"title": "What are your favorite animals?",
"type": "MultipleChoice",
"items": [
"Dog",
"Cat",
"Bird",
"Fish"
]
}
],
"result": {
"title": "Thank you!",
"description": "We are happy to have you here"
}
}
Table of Contents