← Teacher guide

A journal with drawings

Students give every values-journal entry its own drawing: a table Entries with a picture field, an Add a row action, a Table object on the Journal screen and a row click that shows ClickedItem.drawing big. They remember the table between visits, delete the old list and variable, and hand in a .zip made by Save with what the app kept.

Data apps · Saving between visits · about 50 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 8 min · Build 2 7 min · Build 3 12 min · Build 4 8 min · Check 5 min · Hand in 5 min

Before class

This lesson continues App Builder apps › Draw how you showed it, which ends with "only the latest drawing is kept". Students who didn't do it can still follow: the first step uses the finished app, and the starting app is the journal with one drawing.

A picture field holds the name the app gave a drawing (such as media:7f3a09c2); the table shows it as a thumbnail. The drawings themselves are kept in this browser, beside the remembered rows. Forget saved data removes both.

The code checks can't see a field's type, so they can't tell whether drawing was set to Picture. A text field also shows thumbnails for drawings, so nothing breaks either way, but the 🖼 is the right habit: when students type rows into the sidebar, a picture field gives them a picture picker.

Handing in: a Share link carries the app, not what it kept while running, so the teacher sees an empty journal. Save asks whether to include what the app kept; yes gives one .zip (the app, the rows and the drawings) that Open brings back. Drawings, not photos, so there are no faces in what's handed in.

Running the lesson

  1. Try it: ask what changes when you click a different row. (Only the big picture: each row has its own.)
  2. Build 3: checkpoint: two entries, two different thumbnails, each click shows its own.
  3. Build 4: before deleting the old list, ask what still uses it. (Nothing, once Build 3 is done.)
  4. Hand in: show where the Save box asks about what the app kept.

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)

Build 3 changes three things on one screen (the Table, the count, the row click). Students who skip the count change see 'Entries: 0' forever; students who keep the old LastDrawing action see the newest drawing on every row. Point them back to step 3 of Build 3.

When students get stuck

What you will seeA question to askThe fix
Every row shows the same big picture.Which variable does your row click read?Use ClickedItem.drawing, the clicked row's own drawing, not LastDrawing.
The Journal says Entries: 0 though the table has rows.What does the count count?Change count(Journal) to count(Entries) in On start of screen.
The table is empty on the Journal screen.What does the Table show? Look at Shows in Properties.Set Shows to Entries.
After Restart the entries are gone.Is the 💾 beside Entries lit?Click it, as in Saving between visits.

Answers to the checks

  1. Nib's slip: Whichever row Nib clicks, the big picture is always the newest drawing. Click the line where Nib goes wrong.
    line 3
    Line 3: LastDrawing is one variable, holding the drawing from the last Add. The clicked row's own drawing is ClickedItem.drawing.
  2. Sharing: Kai finishes the journal, adds five entries with drawings, and sends the teacher a Share link. What does the teacher see?
    The journal app, with none of Kai's entries
    A Share link carries the app, not what it kept while running: those entries are in Kai's browser. To hand in the entries too, Save and include what the app kept: one file (.zip) with the app, the rows and the drawings.

Solutions

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

Hand it in

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

Stretch and support

Stretch: Add a Remove button: when a row is clicked, remember its index, and Remove deletes that row (as in One table instead). What happens to its drawing?

Support: Do Build 1 together on the board. Pairs do Builds 2 to 4, one driving, one reading the steps.

Exit ticket

A plant log keeps a photo of each plant every week. Why a table with a picture field, not a list of names and a separate list of photos?

One row keeps the name, the date and the photo together, so they can't get out of step when a row is added or removed. Two lists have to be kept matching by hand.

What each step is for

Where it leads

Next: Search, filter and sort, on the playlist. Students could search their journal by value with the same For each.