Session 8 — Ask, Answer & Build a Quiz
Duration: 60 min · Format: live online
Session goal: by the end, students can make a sprite ask a question and wait, read the player's typed answer, check it with an if block, and use a score variable to build a working 3-question quiz — tying together the two big ideas of Unit 2: decisions and variables.
Soft skill focus — Communication
Today's human skill: Communication. A quiz only works if the sprite's question is worded so clearly the player knows exactly how to answer.
- Build it in class: as students write their three questions, have them read one aloud to a neighbour and ask "would you know how to answer that?" — then tighten any wording that confused the listener.
- Reflection (wrap-up): ask "How did you make your quiz question clear and easy to understand?"
Before class — prep
- Open Scratch in a tab (signed in if you can, so you can save) and be ready to screen-share the editor.
- Have the quiz-flow diagram below open to share.
- Know where the pieces live:
ask [ ] and waitand theanswerreporter are in Sensing (cyan);if … thenis in Control (orange);=is in Operators (green); a variable is made in Variables (orange-red) with Make a Variable. - If any student can't run Scratch, have the low-tech fallback (a paper quiz) ready — see Teaching notes.
Hook
Ask the class (chat or unmute):
- "Every program so far has done all the talking. What if the sprite could ask you something and actually wait for your reply? What would you want it to ask?"
Take three answers. Then reveal: "Today your sprite gets ears. It will ask a question, wait while you type, then check if you're right — and keep a score. By the end of the hour you'll each have a real quiz game anyone can play."
Teach — Ask, wait, and the answer reporter
Share this diagram and walk the arrows from "ask" to "answer" to "check":
Explain, slowly, pointing on your shared screen:
ask [ ] and wait(Sensing, cyan) makes the sprite pop up a question with a text box at the bottom of the stage. The script pauses — that's the and wait part — until the player types something and presses Enter.answer(Sensing, cyan) is a reporter — a little rounded block that holds whatever the player just typed. You can drop it inside other blocks or tick its checkbox to show it on the stage.
Build this together:
1. From Sensing (cyan), drag out ask [What is your name?] and wait and click it. A text box appears on the stage — type a name and press Enter.
2. From Sensing, tick the checkbox next to answer — it appears on the stage showing exactly what you typed. That's where the player's reply is stored.
3. From Looks (purple), build say (answer) for 2 seconds — drag the rounded answer block into the say block's white slot. Run it: ask, type, and the sprite repeats your answer back.
Now your script reads:
when green flag clicked
ask "What is your name?" and wait
say answer for 2 seconds
⚠ Watch for this:
answeronly holds the most recent reply. As soon as the nextaskruns, the old answer is replaced. If you need to keep something, check it (or save it) before the nextask.
Ask: "After I type my name, where does Scratch keep it?" (In the answer reporter.) "What does and wait mean?" (The script pauses until the player replies.)
Teach — Check the answer and keep score
Explain: asking is only half a quiz — now we check the answer and reward a right one. This is where Unit 2's two ideas meet: a decision (if) and a variable (score).
Build this together:
1. In Variables (orange-red), click Make a Variable, name it score, and drag out set score to 0 for the top of the script — every game starts at zero.
2. From Sensing, add ask [What is 2 + 2?] and wait.
3. From Control (orange), drag out if … then. From Operators (green), drop ( ) = ( ) into its hexagon slot. Into the left side drop the answer reporter; type 4 on the right. It now reads if <answer = 4> then.
4. Inside the if, put change score by 1 (Variables) and say [Correct!] for 1 seconds (Looks).
Now your script reads:
when green flag clicked
set score to 0
ask "What is 2 + 2?" and wait
if <answer = 4> then
change score by 1
say "Correct!" for 1 seconds
Press the green flag. Type 4 → the sprite says Correct! and the score jumps to 1. Run again and type 5 → nothing happens (the if was false).
Add the "wrong" path. Swap the if for if … then … else and put say [Not quite!] for 1 seconds in the else part, so every answer gets a reply. Now the sprite reacts to both right and wrong.
Ask: "Where does the answer go in the check?" (Into one side of the green = block.) "What makes the score go up only when they're right?" (The change score by 1 sits inside the if — it runs only when the check is true.)
Activity — Build a 3-question quiz
Students build a real, playable quiz. Demo the first question together, then let them add two more and circulate.
- Open a new project at Scratch. Start the script with
when green flag clicked→set score to 0. - Question 1: add
ask [ ] and waitwith your own question, then anif <answer = [ ]> then … elsethat doeschange score by 1+say "Correct!"on the true side andsay "Not quite!"on the else side. - Questions 2 and 3: snap on two more ask + if–else pairs, each with a new question and its own correct answer.
- Show the final score: at the very end add
say (join [You scored ] (score)) for 3 seconds(thejoinblock is in Operators, green) — or just tick thescorecheckbox so it shows on the stage. - Make it yours: pick a theme (animals, football, maths), swap the backdrop, and have the sprite
say "Ready?"before the first question.
Circulate and ask: "Show me where the score goes up — is it inside the if?" "What happens if I spell the answer differently — does it still count?"
Debrief: ask 2–3 students to share their screen and let the class play their quiz live and watch the score climb.
Check for understanding
Ask these aloud or in the chat. Answer key (for you):
- What does
ask [ ] and waitdo? → It shows a question with a text box and pauses the script until the player types a reply and presses Enter. - Where is the player's reply kept? → In the
answerreporter (Sensing) — it holds the most recent thing typed. - Why does
change score by 1go inside theif? → So the score only goes up when the check is true — i.e. when the answer is correct.
Wrap-up + homework
- Ask one student to explain, in one sentence, how the sprite "knows" the player got it right.
- Homework — Finish your quiz: make sure your quiz has 3 questions, gives Correct/Not quite feedback each time, and says the final score at the end. Screenshot the script for your portfolio.
Teaching notes
- Correct this misconception: "the sprite understands what I type." It doesn't — it only checks whether
answerexactly matches the value in the=block.4with a space, orfourinstead of4, will read as wrong. Use this to explain why programmers must think about every way a player might reply. - Fast finishers (extension): have them add a
joinso the sprite says the player's name in every reply (say (join [Nice work, ] (name)) …), or a final message that changes with the score using one moreif–else("You're a champion!" vs "Try again!"). - Low-tech fallback: no devices? Run it on paper. One student is the "sprite" and reads a question; a partner writes an answer; the sprite checks it against a card and makes a tally mark for each correct one. The tally is the
scorevariable, and the check is theif. The idea — ask, store, check, score — is the real lesson; Scratch is just the tool.
Vocabulary
| Term | Meaning |
|---|---|
| ask … and wait | Sensing block that asks a question and pauses for a typed reply |
| answer | A reporter holding the player's most recent typed reply |
| = (equals) | An Operator that checks whether two things are the same |
| if … then | A Control block that runs its blocks only when a check is true |
| Variable | A named box that remembers a value, like score |
Resources
- Scratch editor — where students build (free, in the browser).
- Sensing blocks reference (Scratch Wiki) — explains
ask [ ] and waitand theanswerreporter. - Scratch Ideas page — official tutorials and starter cards, including quiz-style projects.
Practice set
Extra tasks to build up a quiz. Work them easy → hard, at lab time or for homework. Answers follow each arrow.
1. Name that block. Which block makes the sprite ask a question and wait for a typed reply? → ask [ ] and wait (Sensing, cyan).
2. Where's the reply? After the player types, which block holds what they typed? → The answer reporter (Sensing).
3. Colour clue. You need the = block to compare the answer. Which colour palette is it in? → Green — Operators.
4. Predict. The check is if <answer = 4> then → say "Yes!". The player types five. What happens? → Nothing — five does not equal 4, so the if is false and say doesn't run.
5. Make it (build task). Build a script that asks "What colour is the sky?" and says "Correct!" only if the answer is blue. → ask "What colour is the sky?" and wait → if <answer = blue> then → say "Correct!" for 1 seconds.
6. Keep score (harder). Add scoring so a correct answer makes score go up by 1, starting from 0. Where must set score to 0 go, and where must change score by 1 go? → set score to 0 goes at the top (before the questions); change score by 1 goes inside the if, so it only runs when the answer is correct.
Going deeper (optional)
Optional — for a class that has a working quiz and wants to make it fairer and smarter.
Exact matching is strict. Because answer = 4 needs an exact match, real quizzes get tripped up by spaces and capital letters — Blue, blue and BLUE all look "wrong" to a strict check. Programmers fix this by cleaning the answer first (lowercasing it, trimming spaces) or by accepting a few spellings with or. Even just knowing this trap exists makes students better testers of their own game.
One answer box, reused. There is only one answer reporter for the whole project, and every ask overwrites it. That's why you must check each answer right after its question, before the next ask wipes it. If you wanted to remember all three replies, you'd copy each into its own variable — a neat link back to last session's work on variables.
Common mistakes & fixes
- Mistake:
change score by 1placed below theifinstead of inside it, so the score goes up every time. → Fix: drag it inside theif's mouth so it only runs on a correct answer. - Mistake: Forgetting
set score to 0at the start, so the score keeps climbing between plays. → Fix: addset score to 0at the top, right after the green-flag hat. - Mistake: The check never comes true because of a space or capital letter (
4orBlue). → Fix: make sure the value in the=block exactly matches the expected reply — no extra spaces. - Mistake: Dropping
answerinto the wrong slot, or typing the word "answer" instead of using the reporter block. → Fix: drag the roundedanswerblock from Sensing into the=; typed text won't work. - Mistake: Checking an answer after the next
askhas already run, soanswerwas overwritten. → Fix: put eachifright after its own question, before the followingask.
Next session
Session 9 — Catch the Falling Apples: the start of Unit 3 — Build Real Games. Students put decisions, variables and the x–y grid together to build their first full game — apples fall from the top of the stage and the player moves a basket to catch them for points.