Poll

When building a poll you can add:

Single/multiple choice questions

Properties

SingleChoice and MultipleChoice questions work in the same way - a new item gets added to build.blocks, consisting of:

PropertyRequiredTypeDescriptionDefault
titlestringThe question
typestringset to SingleChoice or MultipleChoice
itemsstring[]An array of possible choices
itemsShuffledbooleanIf set to true, the order of the items/choices will be shuffledfalse
requiredbooleanIf set to false, the user can skip the questiontrue

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"
    }
}