{
  "id": "04",
  "content": [
    {
      "type": "heading",
      "text": "Control Flow: if, else, switch"
    },
    {
      "type": "text",
      "html": "<pre><code>&lt;?php\n $score = 78;\n if ($score &gt;= 90) { echo 'A'; }\n elseif ($score &gt;= 80) { echo 'B'; }\n else { echo 'C or below'; }\n</code></pre>"
    },
    {
      "type": "text",
      "html": "<pre><code>&lt;?php\n $day = 'mon';\n switch ($day) {\n   case 'mon': echo 'Hello Monday'; break;\n   case 'tue': echo 'Hello Tuesday'; break;\n   default: echo 'Hello!';\n }\n</code></pre>"
    }
  ],
  "quiz": {
    "questions": [
      {
        "id": "q1",
        "type": "single",
        "text": "Which keyword ends a switch branch?",
        "options": [
          {
            "id": "a",
            "text": "stop"
          },
          {
            "id": "b",
            "text": "break"
          },
          {
            "id": "c",
            "text": "exit"
          }
        ],
        "correct": [
          "b"
        ]
      },
      {
        "id": "q2",
        "type": "single",
        "text": "The <code>elseif</code> block runs when:",
        "options": [
          {
            "id": "a",
            "text": "The if condition failed and elseif is true"
          },
          {
            "id": "b",
            "text": "The if condition was true"
          },
          {
            "id": "c",
            "text": "Never"
          }
        ],
        "correct": [
          "a"
        ]
      }
    ]
  }
}