General blocks

The blocks on this page can be added to any build type, hence considered "general".

Content/Text Block

The Content block is a simple block that can be used to display a title and description. It can be used as an introduction to the quiz (= cover block) or as a conclusion.

Properties

PropertyRequiredTypeDescriptionDefault
titlestringThe title of the content block
descriptionstringThe description of the content block
mediastring|objectMedia to display. Adding it automatically switches its display on. See Use media
mediaOrientationstringHow it is cropped: Settings, Wide, Square, Tall, or OriginalSettings

Example:

{
    "type": "Content",
    "title": "Welcome to the quiz",
    "description": "This quiz will test your knowledge about the world"
}

Ad Block

In the ad block it is optional to add a title and description.

Properties

PropertyRequiredTypeDescriptionDefault
typestringSet to Ad
titlestringThe title of the ad block
descriptionstringThe description of the ad block
mediastring|objectMedia to display alongside the ad. Adding it automatically switches its display on
mediaOrientationstringSettings, Wide, Square, Tall, or OriginalSettings
projectSlotobjectAn ad slot of your project; see below
iframeobjectA custom iframe ad; see below
isNextButtonVisiblebooleanWhether a "next" button is shown so the visitor can continuetrue
showNextButtonDelayintegerHow many seconds to wait before that button appears5
isShowNextButtonAfterDelayEnabledbooleanWhether that delay applies at all. Sending a showNextButtonDelay greater than 0 switches it on; sending false keeps the delay stored but shows the button right away. See feature togglesderived from showNextButtonDelay

Adding ad blocks is possible in two ways:

Project ad slots

To add an ad to your build using a project ad slot, you need to add the property projectSlot in the Ad block, consisting of:

PropertyRequiredTypeDescriptionDefault
slotIdintegerThe ad slot to use
variablesObjectAn object with key-value pairs to override ad slot variables

Note: projectSlot and iframe are mutually exclusive; you cannot set both on the same Ad block.

Example:

{
    "type": "Ad",
    "projectSlot": {
        "slotId": 123456
    }
}

Example with variables:

{
    "type": "Ad",
    "projectSlot": {
        "slotId": 123456,
        "variables": {
            "ad-variable-key1": "override-value1"
        }
    }
}

Custom iframe

To be more flexible with ads and to be more independent from the Riddle Creator, you can add an Ad block with the iframe object set, consisting of:

PropertyRequiredTypeDescriptionDefault
urlURLThe URL the iframe should link to
heightintegerThe height of the iframe in px; automatic resizing does not work with custom iframes80

Example:

{
    "type": "Ad",
    "iframe": {
        "url": "https://ads.your-website.com/ad.html",
        "height": 250
    }
}

Quote Block

The Quote block can be used to display a quote with a author.

Properties

The quote block consists of:

PropertyRequiredTypeDescriptionDefault
typestringSet to Quote
titlestringThe title of the quote block
quoteTextstringThe quote text
quoteAuthorstringThe author of the quote
descriptionstringThe description of the quote block
mediastringA media URL to an image to display as the general image
quoteMediastring|objectMedia to display as the quote image
quoteTextColorstringHex color of the quote text#ffffff
quoteBackgroundColorstringHex color behind the quote#000000
mediaOrientationstringSettings, Wide, Square, Tall, or OriginalSettings

Example

{
    "type": "Quote",
    "title": "Inspiring Quote",
    "description": "A quote to inspire you",
    "media": "https://httpbin.io/image/jpeg",
    "quoteText": "The only limit to our realization of tomorrow is our doubts of today.",
    "quoteAuthor": "Franklin D. Roosevelt",
    "quoteMedia": "https://httpbin.io/image/png"
}

Full example

For this example we build a quiz with a content + ad block.

{
    "type": "Quiz",
    "build": {
        "title": "General blocks example (Builder API)",
        "blocks": [
            {
                "type": "Content",
                "title": "Welcome to the quiz",
                "description": "This quiz will test your knowledge about France"
            },
            {
                "type": "MultipleChoice",
                "title": "What is the capital of France?",
                "items": [
                    { "title": "Paris", "isCorrect": true },
                    { "title": "Lissabon", "isCorrect": false },
                    { "title": "Berlin", "isCorrect": false }
                ]
            },
            {
                "type": "Ad",
                "iframe": {
                    "url": "https://google.com"
                }
            },
            {
                "type": "MultipleChoice",
                "title": "How do you say 'hello' in French?",
                "items": [
                    { "title": "Bonjour", "isCorrect": true },
                    { "title": "Hallo", "isCorrect": false },
                    { "title": "Ciao", "isCorrect": false }
                ]
            },
            {
                "type": "Quote",
                "title": "Inspiring Quote",
                "quoteText": "The only limit to our realization of tomorrow is our doubts of today.",
                "quoteAuthor": "Franklin D. Roosevelt"
            }
        ]
    }
}