# Blank

> Fill the gaps in a sentence, formula, or code with word chips.

```json
{
  "id": "p1",
  "prompt": "Complete the code so it returns a new array of doubled numbers.",
  "explanation": "**map** returns a new array with each number doubled.",
  "type": "blank",
  "template": "const doubled = nums.[[m]](n => n * 2);",
  "format": "code",
  "language": "javascript",
  "caseSensitive": true,
  "blanks": [
    {
      "id": "m",
      "accept": [
        "map"
      ],
      "choices": [
        "map",
        "forEach",
        "filter"
      ],
      "mistakes": [
        {
          "answer": "forEach",
          "feedback": "forEach returns undefined, so `doubled` would be undefined."
        },
        {
          "answer": "filter",
          "feedback": "filter keeps or drops items. It doesn't change them."
        }
      ]
    }
  ]
}
```

A blank brick has a template with one or more gaps, written `[[id]]`. You fill each gap by picking a word chip. v1 has no typed answers, so every gap has chips.

## When to use it

* Completing a sentence, a formula, or a line of code.
* Set `format: "code"` with a `language` for code, usually with `caseSensitive: true`.

## Fields

| Field      | Required | Description                                                                                          |
| ---------- | -------- | ---------------------------------------------------------------------------------------------------- |
| `template` | yes      | Text with `[[gap]]` markers                                                                          |
| `blanks`   | yes      | For each gap: `accept` (right answers), `choices` (the chips), and optional `mistakes` with feedback |
| `format`   | yes      | `text` or `code`                                                                                     |

## More examples

```json
{
  "id": "p3",
  "prompt": "Complete the conversation.",
  "hint": "The second word means “thank you.”",
  "explanation": "**¿Cómo estás?** means how are you. **Gracias** means thank you.",
  "type": "blank",
  "template": "—¿[[c]] estás?\n—Bien, [[g]]. ¿Y tú?",
  "format": "text",
  "lang": "es",
  "blanks": [
    {
      "id": "c",
      "accept": [
        "Cómo"
      ],
      "choices": [
        "Cómo",
        "Dónde",
        "Qué"
      ],
      "mistakes": [
        {
          "answer": "Dónde",
          "feedback": "¿Dónde estás? means “where are you?”"
        },
        {
          "answer": "Qué",
          "feedback": "¿Qué? means “what?” To ask how someone is, use ¿Cómo?"
        }
      ]
    },
    {
      "id": "g",
      "accept": [
        "gracias"
      ],
      "choices": [
        "gracias",
        "adiós",
        "hola"
      ],
      "mistakes": [
        {
          "answer": "adiós",
          "feedback": "Adiós means goodbye."
        },
        {
          "answer": "hola",
          "feedback": "Hola means hello. You need “thank you” here."
        }
      ]
    }
  ]
}
```

```json
{
  "id": "p2",
  "prompt": "Fill in the growth factor for a 5% rate.",
  "explanation": "Multiplying by 1.05 keeps 100% of the balance and adds 5%.",
  "type": "blank",
  "template": "$1,000 × [[g]] = $1,050",
  "format": "text",
  "blanks": [
    {
      "id": "g",
      "accept": [
        "1.05"
      ],
      "choices": [
        "1.05",
        "0.05",
        "1.5"
      ],
      "mistakes": [
        {
          "answer": "0.05",
          "feedback": "0.05 gives only the interest ($50). Multiply by 1.05 to keep the original $1,000 too."
        },
        {
          "answer": "1.5",
          "feedback": "1.5 would be 50% growth. 5% is 0.05, so the factor is 1.05."
        }
      ]
    }
  ]
}
```
