← QCE Digital Solutions Unit 4

JSON structure

JSON stores data as key-value pairs inside {} objects and as ordered lists of values inside [] arrays. Keys are double-quoted strings. Values can be nested.

Understanding JSON structure in QCE Digital Solutions Unit 4

What it does: 17, true and null are not in quotes, because only strings use double quotes. Quoting them would turn them into strings. The key students holds an array, and each item in that array is an object with its own key-value pair. Arrays use square brackets. Curly braces create objects of key-value pairs. A key is a double-quoted string followed by a colon, then the value. JSON does not use = or unquoted keys. A JSON array is an ordered list. The values keep their position, so "red" is always first. Numbers are written without quotes and without currency symbols. "$4.5" is a string, not a number.

Common mistakes: JSON booleans must be lowercase. It should be "active": true. Capital-T True is Python, not JSON. A JSON object of key-value pairs must open with a curly brace {, not a square bracket. It closes with }, so the brackets don't match.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 89–125) and word search (Modules 17–125).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which JSON snippet is valid?
{"name": "Ava", "age": 17}{'name': 'Ava', 'age': 17}
Matches
{'name': 'Ava'}
↓
JSON keys and strings must use double quotes, not single quotes
Applying
Meanings
Term
JSON object and array
Meaning
JSON stores data as key-value pairs inside {} objects and as ordered lists of values inside [] arrays. Keys are double-quoted strings. Values can be nested.
Practice
{
Testing
Gaps
{"name" "Ava", "year": 12}
Check Answer
Spots
3 "age": 16,
4 "active": True

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Constellation Wolf' badge — Space Legend, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which JSON snippet is valid?
A. {"name": "Ava", "age": 17} ✓
B. {'name': 'Ava', 'age': 17}
JSON keys and strings must use double quotes. Single quotes are not valid in JSON.
2. Which brackets hold an ordered list of values in JSON?
A. Square brackets [ ] make an array ✓
B. Curly braces { } make an array
Arrays use square brackets. Curly braces create objects of key-value pairs.
3. Which JSON object stores a key-value pair correctly?
A. {city = "Brisbane"}
B. {"city": "Brisbane"} ✓
A key is a double-quoted string followed by a colon, then the value. JSON does not use = or unquoted keys.
4. Which line stores a boolean and a null correctly?
A. {"active": true, "nickname": null} ✓
B. {"active": "true", "nickname": "null"}
true and false are booleans and null means no value. In quotes they become plain strings, not real booleans or null.
5. How do you read the first item of this JSON array: ["red", "green", "blue"]?
A. Items are unordered, so there is no first item
B. Items are ordered, so "red" is first ✓
A JSON array is an ordered list. The values keep their position, so "red" is always first.

Match the Pairs

{"name": "Ava", "year": 12} → A JSON object: curly braces hold key-value pairs, with double-quoted keys and strings, separated by commas
["Maths", "English", "Science"] → A JSON array: square brackets hold an ordered list of values separated by commas
Numbers, booleans and null are written without quotes, while strings need double quotes → {"age": 17, "active": true, "phone": null}
Values can be nested: an object can hold an array, and an array can hold objects → {"students": [{"name": "Zoe"}, {"name": "Leo"}]}
{'name': 'Ava'} → JSON keys and strings must use double quotes, not single quotes
{"id": 1, "score": "88", "pass": "true"} → The number 88 and the boolean true are wrapped in quotes, so they are stored as strings rather than a number and a boolean

Key Term

JSON object and array
JSON stores data as key-value pairs inside {} objects and as ordered lists of values inside [] arrays. Keys are double-quoted strings. Values can be nested.

Fill in the Blanks

1. {"name": "Ava", "year": 12}
Hint: Type the character that separates a key from its value.
2. {"scores": [88, 74, 91]}
Hint: Type the bracket that opens an ordered list of values.
3. {"age": 17, "isAdult": false}
Hint: Type the lowercase boolean literal (no quotes) that is correct for a 17-year-old.
4. {"name": "Zoe", "middleName": null}
Hint: Type the JSON literal that means there is no value.
5. {"pet": {"name": "Rex", "age": 3}}
Hint: Type the character that opens a nested object inside the value.

Spot the Error

Question 1
A {
B "name": "Ava",
C "age": 16,
D "active": True
E }
Line D — JSON booleans must be lowercase. It should be "active": true. Capital-T True is Python, not JSON.
Question 2
A [
B "city": "Brisbane",
C "temp": 28
D }
Line A — A JSON object of key-value pairs must open with a curly brace {, not a square bracket. It closes with }, so the brackets don't match.
Question 3
A {
B "id": 7,
C "tags": ["a", "b"],
D "note": nil
E }
Line D — JSON's empty value is null, not nil. The line should be "note": null.
Question 4
A {
B "scores": (88, 74, 91),
C "pass": true
D }
Line B — JSON arrays use square brackets, not round brackets. It should be "scores": [88, 74, 91],.
Question 5
A {
B user: {
C "name": "Liam"
D }
E }
Line B — Every JSON key must be a double-quoted string, even for a nested object. It should be "user": {.

Student with a class code? Join your class →