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.
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.
Adding ad blocks is possible in two ways:
- By using project ad slots
- By implementing a custom iframe
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:
| Property | Required | Type | Description | Default | 
|---|---|---|---|---|
| slotId | ✓ | Object | The ad slot to use | |
| variables | Object | An object with key-value pairs to override ad slot variables | 
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:
| Property | Required | Type | Description | Default | 
|---|---|---|---|---|
| url | ✓ | URL | The URL the iframe should link to | |
| height | integer | The height of the iframe in px; automatic resizing does not work with custom iframes | 80 | 
Example:
{
    "type": "Ad",
    "iframe": {
        "url": "https://www.example.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:
| Property | Required | Type | Description | Default | 
|---|---|---|---|---|
| title | ✓ | string | The title of the quote block | |
| description | string | The description of the quote block | ||
| media | string | A media URL to an image to display as the general image | ||
| type | ✓ | string | Set to Quote | |
| quoteText | ✓ | string | The quote text | |
| quoteAuthor | ✓ | string | The author of the quote | |
| quoteMedia | string | A media URL to an image to display as the quote image | 
Example
{
    "type": "Quote",
    "title": "Inspiring Quote",
    "description": "A quote to inspire you",
    "media": "https://example.com/general-image.jpg",
    "quoteText": "The only limit to our realization of tomorrow is our doubts of today.",
    "quoteAuthor": "Franklin D. Roosevelt",
    "quoteMedia": "https://example.com/quote-image.jpg"
}
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": {
                    "Paris": true,
                    "Lissabon": false,
                    "Berlin": false
                }
            },
            {
                "type": "Ad",
                "iframe": {
                    "url": "https://google.com"
                }
            },
            {
                "type": "MultipleChoice",
                "title": "How do you say 'hello' in French?",
                "items": {
                    "Bonjour": true,
                    "Hallo": false,
                    "Ciao": false
                }
            },
            {
                "type": "Quote",
                "title": "Inspiring Quote",
                "quoteText": "The only limit to our realization of tomorrow is our doubts of today.",
                "quoteAuthor": "Franklin D. Roosevelt"
            }
        ]
    }
}

