← Teacher guide

Draw how you showed it

Students add drawing to the values journal: a Drawing object on Describe (cleared when the screen starts), Drawing.picture kept in a variable when Add is clicked, and an Image on the Journal screen that shows it with Set picture to the one in. They find out that action order matters (Nib clears the page before keeping it) and that one variable keeps only the latest drawing, which sets up tables in Data apps.

App Builder apps · Pictures from the user · about 45 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 10 min · Build 2 8 min · Build 3 10 min · Check 7 min · Make it yours 5 min

Before class

This lesson starts from the finished values journal with room made for a drawing (Add moved down on Describe, the list shorter on Journal). Students who missed the journal lesson can still do it: the first step has them use the finished app.

A drawing is made while the app runs. Drawing.picture turns it into a picture the app keeps in the browser (on this device, nothing is sent) and names it, such as media:7f3a09c2. Variables, lists and tables hold that name. Drawings, not photos, so there are no faces.

If a student clicks Add without drawing anything, the Journal says "There is no picture yet". That's honest: there's nothing to show. An If (LastDrawing is not "") is a fine extra for a quick student.

The second check question is the set-up for Data apps › A journal with drawings, where a table keeps a drawing with every entry.

Handing in: drawings are made while the app runs, so a Share link carries the app but not the student's entries. To hand in entries with their drawings, students use Save and include what the app kept (a .zip).

Running the lesson

  1. Try it: ask students to watch LastDrawing on the left as they click Add. What does media:… mean?
  2. Build 3: checkpoint: does the drawing show on the Journal? If it says there's no picture, did they draw before Add?
  3. Check: take a vote on the two-entries question before anyone tries it.

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)

The two picture actions look alike. Set picture to picks a picture while you design; Set picture to the one in works one out while the app runs. If students pick the first, the list of choices has no drawing in it: that's the clue.

When students get stuck

What you will seeA question to askThe fix
The Journal says 'There is no picture yet'.Did you draw before you clicked Add? Which runs first in your Add event: Clear or Set variable?Draw first; and keep the picture before clearing (or clear only on start of screen).
The Image shows a star, not the drawing.Which picture action did you use?Use Set LastImage picture to the one in, with LastDrawing.
The drawing from last time is still there on Describe.What happens when the Describe screen starts?Add Clear Drawing to On start of screen.

Answers to the checks

  1. Nib's slip: Nib's Journal shows the error "There is no picture yet", even though Nib drew something. Click the line where Nib first goes wrong.
    line 2
    Line 2: Clear Drawing runs before Drawing.picture is read, so the page is empty when Add keeps it. Actions run in order, top to bottom: keep the picture first (or clear it when the screen starts, as in Build 1).
  2. Two entries: You add a Kindness entry with a heart drawing, then a Courage entry with a star. What does the Journal screen show?
    Both entries in the list, and only the star drawing
    The list keeps every entry, but LastDrawing is one variable: the star replaces the heart. Keeping a drawing with every entry needs somewhere that holds many, such as a table (the Data apps course does this next).

Solutions

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

Make it yours: Clear and Undo › A Clear button

{"version":1,"name":"Values journal (drawings)","features":{"level":3},"variables":[{"name":"Chosen","value":""},{"name":"LastDrawing","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":530,"w":342,"h":48,"text":"Add to my journal","visible":true,"vars":{}}]},{"name":"Drawing","kind":"drawing","instanceVars":[],"instances":[{"id":"dd1","x":229,"y":184,"w":342,"h":280,"text":"","visible":true,"vars":{},"color":"#222222","pen":4,"background":""}]},{"name":"ClearButton","kind":"button","instanceVars":[],"instances":[{"id":"dc1","x":229,"y":472,"w":165,"h":44,"text":"Clear","visible":true,"vars":{}}]}],"events":[{"id":"jd1","else":false,"conds":[{"type":"onStart"}],"actions":[{"type":"setText","target":"Question","value":"\"What did you do to show \" & Chosen & \"?\""},{"type":"clearDrawing","target":"Drawing"}],"children":[]},{"id":"jd2","else":false,"conds":[{"type":"onClicked","target":"AddButton"}],"actions":[{"type":"listAdd","value":"uppercase(Chosen) & \": \" & NoteInput.text","list":"Journal"},{"type":"setVar","var":"LastDrawing","value":"Drawing.picture"},{"type":"goToScreen","screen":"journal"}],"children":[]},{"id":"dc2","else":false,"conds":[{"type":"onClicked","target":"ClearButton"}],"actions":[{"type":"clearDrawing","target":"Drawing"}],"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":210,"text":"","visible":true,"vars":{},"source":"Journal"}]},{"name":"LastImage","kind":"image","instanceVars":[],"instances":[{"id":"jl1","x":335,"y":335,"w":130,"h":130,"text":"","visible":true,"vars":{},"image":"star"}]},{"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)"},{"type":"setImageFrom","target":"LastImage","value":"LastDrawing"}],"children":[]},{"id":"jj2","else":false,"conds":[{"type":"onClicked","target":"AnotherButton"}],"actions":[{"type":"goToScreen","screen":"choose"}],"children":[]}]}],"device":"web"}

Make it yours: Clear and Undo › An Undo button

{"version":1,"name":"Values journal (drawings)","features":{"level":3},"variables":[{"name":"Chosen","value":""},{"name":"LastDrawing","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":530,"w":342,"h":48,"text":"Add to my journal","visible":true,"vars":{}}]},{"name":"Drawing","kind":"drawing","instanceVars":[],"instances":[{"id":"dd1","x":229,"y":184,"w":342,"h":280,"text":"","visible":true,"vars":{},"color":"#222222","pen":4,"background":""}]},{"name":"ClearButton","kind":"button","instanceVars":[],"instances":[{"id":"dc1","x":229,"y":472,"w":165,"h":44,"text":"Clear","visible":true,"vars":{}}]},{"name":"UndoButton","kind":"button","instanceVars":[],"instances":[{"id":"du1","x":406,"y":472,"w":165,"h":44,"text":"Undo","visible":true,"vars":{}}]}],"events":[{"id":"jd1","else":false,"conds":[{"type":"onStart"}],"actions":[{"type":"setText","target":"Question","value":"\"What did you do to show \" & Chosen & \"?\""},{"type":"clearDrawing","target":"Drawing"}],"children":[]},{"id":"jd2","else":false,"conds":[{"type":"onClicked","target":"AddButton"}],"actions":[{"type":"listAdd","value":"uppercase(Chosen) & \": \" & NoteInput.text","list":"Journal"},{"type":"setVar","var":"LastDrawing","value":"Drawing.picture"},{"type":"goToScreen","screen":"journal"}],"children":[]},{"id":"dc2","else":false,"conds":[{"type":"onClicked","target":"ClearButton"}],"actions":[{"type":"clearDrawing","target":"Drawing"}],"children":[]},{"id":"du2","else":false,"conds":[{"type":"onClicked","target":"UndoButton"}],"actions":[{"type":"undoDrawing","target":"Drawing"}],"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":210,"text":"","visible":true,"vars":{},"source":"Journal"}]},{"name":"LastImage","kind":"image","instanceVars":[],"instances":[{"id":"jl1","x":335,"y":335,"w":130,"h":130,"text":"","visible":true,"vars":{},"image":"star"}]},{"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)"},{"type":"setImageFrom","target":"LastImage","value":"LastDrawing"}],"children":[]},{"id":"jj2","else":false,"conds":[{"type":"onClicked","target":"AnotherButton"}],"actions":[{"type":"goToScreen","screen":"choose"}],"children":[]}]}],"device":"web"}

Stretch and support

Stretch: Set the pen colour by value on Describe's start: an If on Chosen, with a colour for each value (Set pen colour of Drawing to "red").

Support: Do Build 1 together on the board; pairs do Builds 2 and 3.

Exit ticket

Your app keeps a photo when a Take photo button is clicked, then clears the photo for next time. Which should come first, and why?

Keep the photo first (set the variable to Photo.picture), then clear. Actions run top to bottom; clearing first would keep an empty picture.

What each step is for

Where it leads

Next: Show it's done: photos, the same idea with a Photo, a picture per chore. In Data apps, A journal with drawings keeps a drawing with every entry, in a table.