← Teacher guide

A values journal

Students build a three-screen journal: choose a value, describe what they did, and see every entry in a list. A whole-app variable (Chosen) carries the choice between screens, a list variable (Journal) stores entries with Add to the end of list, and a List object on screen 3 shows the list.

App Builder apps · Screens and lists · about 75 minutes · Open the student lesson

Classroom resources

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.

Students will be able to

Timing

Try 5 min · Build 1–4 35 min · Check 8 min · Make it yours 20 min

Before class

The values are examples. Use your school's own values if it has them, or let students choose four that matter to them. Entries are personal: the app keeps them in the browser on the student's own device and nothing is collected or shared. Keep any class discussion on made-up entries.

Each screen has its own events. The Events tab's heading names the screen; switch screens by clicking a screen's name in the sidebar.

Run starts on the screen you were editing. To test the whole flow, open the Choose screen first.

The List object shows a list variable by itself (its Shows property), so no loop is needed to fill it. Loops (For each, LoopIndex) come up in the Check step, and for real in the next lesson.

The journal forgets entries when the project is restarted. That's fine for a prototype.

Running the lesson

  1. Before Build 2 (whole class, on the deck): will screen 2 know which value was clicked on screen 1? Ask what 'whole app' might mean.
  2. Build 2: checkpoint: does screen 2 show the chosen value? Fix that before lists.
  3. Check: write LoopIndex 1, 2, 3 under three entries on the board, and point to item(Journal, 1), item(Journal, 2), item(Journal, 3).
  4. Make it yours: pair students from different tables, so the tester hasn't seen the app built.

In class

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.

The hard part (on purpose)

This is the longest build in the course, and the most common failure is adding events on the wrong screen. The Events tab shows the events of the screen open in the sidebar; check its heading before anyone debugs further.

When students get stuck

What you will seeA question to askThe fix
A screen's buttons do nothing.Which screen were the events added to?Look at the Events tab's heading. Move the event by rebuilding it on the right screen.
Screen 3's list is empty.What does the List's Shows property say, and does the Add run before Go to screen?Set Shows to Journal, and keep Add to the end of list above Go to screen in AddButton's event.
The question says 'What did you do to show ?'Did you run from the Choose screen?Open the Choose screen, then Run, so a value is chosen first.

Answers to the checks

  1. Count with LoopIndex: Journal has 3 entries. An event For each item in list Journal runs once per item. What is LoopIndex each time?
    1, then 2, then 3
    For each runs once per item, and LoopIndex counts 1, 2, 3. LoopItem is that item, the same as item(Journal, LoopIndex).
  2. Find Nib's mistake: Nib's journal only ever shows the latest entry. Click the line where Nib first goes wrong.
    line 2
    Line 2: Clear list Journal runs on every click, just before the new entry is added, so the list only ever holds one entry. Adding to the end is enough: the list keeps the old entries.

Solutions

One possible solution for each task. Other correct programs are fine.

Make it yours: count, then test the flow › Count the entries

{"version":1,"name":"Values journal","features":{"level":3},"variables":[{"name":"Chosen","value":""},{"name":"Journal","value":[]}],"screens":[{"id":"choose","name":"Choose","objects":[{"name":"Title","kind":"text","instanceVars":[],"instances":[{"id":"j1","x":229,"y":30,"w":342,"h":36,"text":"Values journal","visible":true,"vars":{}}]},{"name":"Prompt","kind":"text","instanceVars":[],"instances":[{"id":"j2","x":229,"y":74,"w":342,"h":40,"text":"Which value did you show today?","visible":true,"vars":{}}]},{"name":"KindnessPicture","kind":"image","instanceVars":[],"instances":[{"id":"v0p","x":263,"y":140,"w":100,"h":100,"text":"Kindness","visible":true,"vars":{},"image":"heart"}]},{"name":"KindnessButton","kind":"button","instanceVars":[],"instances":[{"id":"v0b","x":229,"y":250,"w":165,"h":46,"text":"Kindness","visible":true,"vars":{}}]},{"name":"CouragePicture","kind":"image","instanceVars":[],"instances":[{"id":"v1p","x":440,"y":140,"w":100,"h":100,"text":"Courage","visible":true,"vars":{},"image":"star"}]},{"name":"CourageButton","kind":"button","instanceVars":[],"instances":[{"id":"v1b","x":406,"y":250,"w":165,"h":46,"text":"Courage","visible":true,"vars":{}}]},{"name":"HonestyPicture","kind":"image","instanceVars":[],"instances":[{"id":"v2p","x":263,"y":340,"w":100,"h":100,"text":"Honesty","visible":true,"vars":{},"image":"tick"}]},{"name":"HonestyButton","kind":"button","instanceVars":[],"instances":[{"id":"v2b","x":229,"y":450,"w":165,"h":46,"text":"Honesty","visible":true,"vars":{}}]},{"name":"RespectPicture","kind":"image","instanceVars":[],"instances":[{"id":"v3p","x":440,"y":340,"w":100,"h":100,"text":"Respect","visible":true,"vars":{},"image":"smile"}]},{"name":"RespectButton","kind":"button","instanceVars":[],"instances":[{"id":"v3b","x":406,"y":450,"w":165,"h":46,"text":"Respect","visible":true,"vars":{}}]}],"events":[{"id":"jv0","else":false,"conds":[{"type":"onClicked","target":"KindnessButton"}],"actions":[{"type":"setVar","var":"Chosen","value":"\"Kindness\""},{"type":"goToScreen","screen":"describe"}],"children":[]},{"id":"jv1","else":false,"conds":[{"type":"onClicked","target":"CourageButton"}],"actions":[{"type":"setVar","var":"Chosen","value":"\"Courage\""},{"type":"goToScreen","screen":"describe"}],"children":[]},{"id":"jv2","else":false,"conds":[{"type":"onClicked","target":"HonestyButton"}],"actions":[{"type":"setVar","var":"Chosen","value":"\"Honesty\""},{"type":"goToScreen","screen":"describe"}],"children":[]},{"id":"jv3","else":false,"conds":[{"type":"onClicked","target":"RespectButton"}],"actions":[{"type":"setVar","var":"Chosen","value":"\"Respect\""},{"type":"goToScreen","screen":"describe"}],"children":[]}]},{"id":"describe","name":"Describe","objects":[{"name":"Question","kind":"text","instanceVars":[],"instances":[{"id":"j3","x":229,"y":40,"w":342,"h":64,"text":"","visible":true,"vars":{}}]},{"name":"NoteInput","kind":"input","instanceVars":[],"instances":[{"id":"j4","x":229,"y":120,"w":342,"h":46,"text":"","visible":true,"vars":{}}]},{"name":"AddButton","kind":"button","instanceVars":[],"instances":[{"id":"j5","x":229,"y":184,"w":342,"h":48,"text":"Add to my journal","visible":true,"vars":{}}]}],"events":[{"id":"jd1","else":false,"conds":[{"type":"onStart"}],"actions":[{"type":"setText","target":"Question","value":"\"What did you do to show \" & Chosen & \"?\""}],"children":[]},{"id":"jd2","else":false,"conds":[{"type":"onClicked","target":"AddButton"}],"actions":[{"type":"listAdd","value":"uppercase(Chosen) & \": \" & NoteInput.text","list":"Journal"},{"type":"goToScreen","screen":"journal"}],"children":[]}]},{"id":"journal","name":"Journal","objects":[{"name":"Heading","kind":"text","instanceVars":[],"instances":[{"id":"j6","x":229,"y":30,"w":342,"h":36,"text":"My values in action","visible":true,"vars":{}}]},{"name":"Count","kind":"text","instanceVars":[],"instances":[{"id":"j7","x":229,"y":72,"w":342,"h":30,"text":"","visible":true,"vars":{}}]},{"name":"List","kind":"list","instanceVars":[],"instances":[{"id":"j8","x":229,"y":110,"w":342,"h":360,"text":"","visible":true,"vars":{},"source":"Journal"}]},{"name":"AnotherButton","kind":"button","instanceVars":[],"instances":[{"id":"j9","x":229,"y":490,"w":342,"h":48,"text":"Add another","visible":true,"vars":{}}]}],"events":[{"id":"jj1","else":false,"conds":[{"type":"onStart"}],"actions":[{"type":"setText","target":"Count","value":"\"Entries: \" & count(Journal)"}],"children":[]},{"id":"jj2","else":false,"conds":[{"type":"onClicked","target":"AnotherButton"}],"actions":[{"type":"goToScreen","screen":"choose"}],"children":[]}]}],"device":"web"}

Make it yours: count, then test the flow › Test the flow

Open task: any program that does what the step asks.

Stretch and support

Stretch: Show only the Courage entries: on the Journal screen, use For each item in list Journal with a condition on LoopItem, and add matching ones to a second list.

Support: Build screens 1 and 2 as a class first, then let students build screen 3 in pairs.

Exit ticket

A shopping app has a Cart screen and a Pay screen. The Cart screen sets a variable Total to 25. How can the Pay screen show $25?

Make Total a whole-app variable (in the sidebar); it keeps its value when the app goes to the Pay screen, so the Pay screen can set its text from it.

What each step is for

Where it leads

Next: Creature stats, where one object has many copies, each with its own values.