Students make a checklist of jobs as tick boxes (Toggles with the Tick box look, which switch themselves), then build a 🌙 Dark / ☀️ Light button by hand with a true/false variable Dark. They first build a button that goes dark and stays dark, then try two separate click events (which cancel each other on one click), then fix it with one click event, a sub-event and an Else.
Open these in Waypoints Prepare with one click. To share a file another way, copy its address and paste it into Load URL, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
Try 5 min · Build (five short steps) 32 min · Check 8 min · Make it yours 15 min
Needs App Builder 1.11 or later (the tick box look is 1.10, colours while the app runs are 1.11). The lesson's playground already has it.
The jobs are Toggles. Look: Tick box changes only how they look: BedJob.on is true or false either way, and "is switched" and "is on" work the same. A Toggle can't be given a colour, so the jobs sit on a light card (a Box) that stays light in dark mode.
Sub-events and Else are added from an event's ⋯ menu (Add a sub-event, Add an Else below). Select the event first by clicking it.
Dark is a true/false variable: it starts at false. Conditions compare it with = (Variable Dark = false). In a formula, App Builder's if() needs a comparison too: if(Dark = true, "On", "Off"), not if(Dark, …).
The emoji ☀️ and 🌙 paste fine on most laptops; if one shows an empty square, use "Light" and "Dark" instead, in the actions and in the button's text.
The one idea: on one click, every event whose conditions are true runs, top to bottom. One trigger with two branches (a sub-event and an Else) means exactly one runs.
On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.
Each is a toggle: one press, then one of two outcomes depending on what it is now. In App Builder that's one event with a sub-event and an Else. The tick boxes in Build 1 are App Builder's built-in toggle; the dark mode button is the same idea built by hand.
Two students stand up as the two flat events, each with a card: "If light, go dark" and "If dark, go light". Turn the room lights on and say "click". They act in order: lights off, then straight back on. The class watches the room end where it started. Then redo it with one student as the event and two as the branches, where only one may act.
Every matching event runs on one click, in order.
Building the version that doesn't work on purpose (Build 3) feels like wasted effort, and Build 4 asks students to delete it and type the actions again. That's the point: they need to see two flat events cancel before the sub-event makes sense. Pairs can share the typing.
| What you will see | A question to ask | The fix |
|---|---|---|
| The screen doesn't go dark at all. | What does the condition check, and what does Dark start at? | Dark starts at false, so the dark branch checks Variable Dark = false. Type false with no quote marks. |
| The colour action is missing for a job. | What kind of object is the job? | Toggles can't be coloured; that's why the jobs sit on a light card. Set colours only on Texts, Boxes and Buttons. |
| There's no Add a sub-event in the menu. | Which level is the app on? | Sub-events need level 2 or more. In a lesson the level is set for you; if the menu lacks it, tell your teacher. |
| Done goes up when unticking. | Which branch has the add 1? | Add 1 belongs in the BedJob is on branch (it's just been ticked); subtract 1 in the Else. |
One possible solution for each task. Other correct programs are fine.
{"version":1,"name":"Chores checklist","features":{"level":2},"variables":[{"name":"Dark","value":false},{"name":"Done","value":0}],"screens":[{"id":"main","name":"Chores","objects":[{"name":"Title","kind":"text","instanceVars":[],"instances":[{"id":"title","x":229,"y":40,"w":342,"h":36,"text":"My jobs today","visible":true,"vars":{}}]},{"name":"Card","kind":"shape","instanceVars":[],"instances":[{"id":"card","x":213,"y":96,"w":374,"h":204,"text":"","visible":true,"vars":{},"color":"#f1f4f9"}]},{"name":"BedJob","kind":"toggle","instanceVars":[],"instances":[{"id":"bedjob","x":229,"y":108,"w":326,"h":40,"text":"Make my bed","visible":true,"vars":{},"on":false,"look":"tick"}]},{"name":"FeedJob","kind":"toggle","instanceVars":[],"instances":[{"id":"feedjob","x":229,"y":160,"w":326,"h":40,"text":"Feed the dog","visible":true,"vars":{},"on":false,"look":"tick"}]},{"name":"HomeworkJob","kind":"toggle","instanceVars":[],"instances":[{"id":"homeworkjob","x":229,"y":212,"w":326,"h":40,"text":"Do my homework","visible":true,"vars":{},"on":false,"look":"tick"}]},{"name":"DoneText","kind":"text","instanceVars":[],"instances":[{"id":"donetext","x":229,"y":256,"w":326,"h":32,"text":"Done: 0 of 3","visible":true,"vars":{}}]},{"name":"ModeButton","kind":"button","instanceVars":[],"instances":[{"id":"modebutton","x":229,"y":312,"w":160,"h":46,"text":"🌙 Dark","visible":true,"vars":{}}]}],"events":[{"id":"m1","else":false,"conds":[{"type":"onClicked","target":"ModeButton"}],"actions":[],"children":[{"id":"m1a","else":false,"conds":[{"type":"compareVar","var":"Dark","op":"=","value":"false"}],"actions":[{"type":"setVar","var":"Dark","value":"true"},{"type":"setBackground","value":"\"#1c2333\""},{"type":"setColour","target":"Title","value":"\"white\""},{"type":"setText","target":"ModeButton","value":"\"☀️ Light\""}],"children":[]},{"id":"m1e","else":true,"conds":[],"actions":[{"type":"setVar","var":"Dark","value":"false"},{"type":"setBackground","value":"\"white\""},{"type":"setColour","target":"Title","value":"\"black\""},{"type":"setText","target":"ModeButton","value":"\"🌙 Dark\""}],"children":[]}]},{"id":"BedJob","else":false,"conds":[{"type":"onToggled","target":"BedJob"}],"actions":[],"children":[{"id":"BedJoba","else":false,"conds":[{"type":"isOn","target":"BedJob","state":"on"}],"actions":[{"type":"addTo","var":"Done","value":"1"},{"type":"setText","target":"DoneText","value":"\"Done: \" & Done & \" of 3\""}],"children":[]},{"id":"BedJobe","else":true,"conds":[],"actions":[{"type":"subtractFrom","var":"Done","value":"1"},{"type":"setText","target":"DoneText","value":"\"Done: \" & Done & \" of 3\""}],"children":[]}]},{"id":"FeedJob","else":false,"conds":[{"type":"onToggled","target":"FeedJob"}],"actions":[],"children":[{"id":"FeedJoba","else":false,"conds":[{"type":"isOn","target":"FeedJob","state":"on"}],"actions":[{"type":"addTo","var":"Done","value":"1"},{"type":"setText","target":"DoneText","value":"\"Done: \" & Done & \" of 3\""}],"children":[]},{"id":"FeedJobe","else":true,"conds":[],"actions":[{"type":"subtractFrom","var":"Done","value":"1"},{"type":"setText","target":"DoneText","value":"\"Done: \" & Done & \" of 3\""}],"children":[]}]},{"id":"HomeworkJob","else":false,"conds":[{"type":"onToggled","target":"HomeworkJob"}],"actions":[],"children":[{"id":"HomeworkJoba","else":false,"conds":[{"type":"isOn","target":"HomeworkJob","state":"on"}],"actions":[{"type":"addTo","var":"Done","value":"1"},{"type":"setText","target":"DoneText","value":"\"Done: \" & Done & \" of 3\""}],"children":[]},{"id":"HomeworkJobe","else":true,"conds":[],"actions":[{"type":"subtractFrom","var":"Done","value":"1"},{"type":"setText","target":"DoneText","value":"\"Done: \" & Done & \" of 3\""}],"children":[]}]}]}],"device":"web"}
Open task: any program that does what the step asks.
Stretch: Show "All done!" when Done is 3: set DoneText to if(Done = 3, "All done!", "Done: " & Done & " of 3"). Or swap ModeButton for a Toggle with the Switch look, and use ModeButton is switched with ModeButton is on.
Support: Give pairs the finished event (the table at the end of Build 5) to copy, then ask them to explain each row.
A mute button app has two events: Mute clicked and Muted = false → set Muted to true; clicked and Muted = true → set Muted to false. What happens when you click, and how do you fix it?
Both run on one click, so it mutes then straight away unmutes. Fix: one click event with a sub-event (Muted = false → mute) and an Else (unmute).
Next: Water tracker, which keeps a display up to date every tick and checks a goal.