← App Builder apps

Show it's done: photos

Give the chores checklist a photo for each chore: tick a chore, then take a photo or choose one, and it appears beside that chore. A variable remembers which chore was ticked, and the photo event checks it.

Apps ask for proof all the time: a photo of the parcel at the door, the receipt, the finished job. The app has to know which job each photo belongs to.

The chores checklist from earlier has a tick box for each chore. Today each chore also gets a photo to show it's done: the made bed, the dog's bowl, the finished homework.

Photos of things, not people. They stay in this browser: nothing is sent anywhere.

How this lesson works: See it, Build, Check, Make it yours
See itTry the finished thing first, so you know what you are building.

Try the finished app

  1. Tick Make my bed.
  2. Click 🖼 Choose a photo and pick any photo on your computer, or tap the camera to start it and press the round button.
  3. The photo appears beside Make my bed. Now tick another chore and add another photo.

No camera, or your school blocks it? Choose a photo works everywhere.

Try it yourselfYour edits are saved in this browser.

BuildWatch the short clip, then do the steps. Your app carries on from the step before.

Build 1: a Photo object

  1. + Add object, Photo. Rename it Camera and put it under the 🌙 Dark button (x 229, y 372).
  2. In its Properties, tick Allow camera in this app. The browser will ask too.
  3. Run it: tap the Photo to start the camera, or click Choose a photo.

We've made room beside each chore for its photo: BedPic, FeedPic and HomeworkPic. They're hidden until they have a photo.

A Photo object · Sound on for the voiceover
Try it yourselfYour edits are saved in this browser.

A Photo object called Camera.

    Run your program. This ticks when your code does all of the above.

    BuildWatch the short clip, then do the steps. Your app carries on from the step before.

    Build 2: remember which chore

    1. Add a variable ForChore. Leave it empty.
    2. Add an event: BedJob, BedJob is switched. It runs when the tick box is ticked or unticked.
    3. From its ⋯ menu, Add a sub-event: BedJob, BedJob is on (it's just been ticked), with the action Set variable ForChore to "Bed".
    4. Do the same for FeedJob ("Feed") and HomeworkJob ("Homework").
    5. Run it and tick a chore. Watch ForChore on the left.

    Why only when ticking, not unticking? A photo shows a chore is done.

    Try it yourselfYour edits are saved in this browser.

    A variable ForChore, set to "Bed", "Feed" or "Homework" when that chore is ticked.

      Run your program. This ticks when your code does all of the above.

      BuildWatch the short clip, then do the steps. Your app carries on from the step before.

      Build 3: put the photo beside its chore

      1. Add an event: Camera, A photo is taken with Camera.
      2. From its ⋯ menu, Add a sub-event: Variables, Variable ForChore = "Bed", with two actions:
        • BedPic, Set BedPic picture to the one in Camera.picture
        • BedPic, Show BedPic
      3. Add two more sub-events under the photo event, the same way, for "Feed" (FeedPic) and "Homework" (HomeworkPic).
      4. Run it: tick a chore, add a photo, then another chore and another photo.
      A photo event that checks which chore · Sound on for the voiceover
      Try it yourselfYour edits are saved in this browser.

      When a photo is taken, the chore ForChore names shows it: BedPic for "Bed", FeedPic for "Feed", HomeworkPic for "Homework".

        Run your program. This ticks when your code does all of the above.

        CheckA quick check that the idea has stuck.

        Check: which chore gets it?

        Watch ForChore on the left as you try it.

        Nib set ForChore when ticking, just like you.

        You tick Do my homework, then untick it, then choose a photo. Where does the photo go?

        Every photo Nib adds appears beside Make my bed, whichever chore was ticked. Click the line where Nib goes wrong.

        Make it yoursChange your app on purpose, then try it on someone.

        Make it yours: untick hides the photo

        When a chore is unticked, its photo should go too. Select each is on sub-event, choose ⋯, Add an Else below (it runs when the chore is unticked), and give it Hide BedPic (or FeedPic, HomeworkPic). A new photo shows it again.

        More ideas: a Take a photo button of your own (untick Show a take-photo button on the Photo, then Take a photo with Camera in your button's event, with what comes next in that same event), or set ForChore back to "" when unticking, so a photo with nothing ticked goes nowhere.

        Try it yourselfYour edits are saved in this browser.

        Unticking a chore hides its photo.

          Run your program. This ticks when your code does all of the above.

          Now you can
          Next lesson8. Record your practiceGive the practice tracker a recorder: record a few seconds of today's practice, play it back, and see how long it was. The recording only exists once the user stops recording, so the app uses it in that event, not before.
          For teachers

          Students give the chores checklist a photo per chore. A Photo object (camera allowed, or Choose a photo), a variable ForChore set when a chore's tick box is switched on, and one event, A photo is taken with Camera, whose sub-events check ForChore and show the photo beside the right chore. Nib's photo event skips the check, so every photo lands beside the bed. About 45 minutes.

          Open the teacher guide: answers, solutions, slides and a worksheet.

          Students will be able to

          Before class

          This lesson starts from the finished chores checklist (tick boxes and the dark mode button), with room made beside each chore for a hidden picture (BedPic, FeedPic, HomeworkPic). It's Level 3 (Photo); each step opens App Builder at Level 3. It follows Draw how you showed it, which met a picture the user makes, and the values journal, where a variable carried a choice between screens.

          Camera: off unless Allow camera is ticked in the Photo's properties, and the browser asks too. Some school devices block cameras; Choose a photo (the button on every Photo) works everywhere, with no permission, and runs the same event. Photos stay in this browser (nothing is uploaded) and are shrunk to at most 1280 px.

          Photos of things, not people: say so before the Try step. Students shouldn't photograph each other.

          The second check question shows a gap on purpose: unticking doesn't clear ForChore, so a photo still goes to the last chore ticked. Make it yours hides the photo on untick; resetting ForChore to "" is in the ideas.

          Running the lesson

          1. Before Try: photos of objects only. Choose a photo works if cameras are blocked.
          2. Build 2: ask what the photo event will know when it runs. Write ForChore on the board.
          3. Build 3: checkpoint: two chores, two photos, each beside its own chore.

          The hard part (on purpose)

          The tick and the photo are two different moments, and students expect the photo event to just know which chore it's for. Ask: when the photo arrives, what does the app know? Only what something wrote down earlier: ForChore.

          When students get stuck

          Stretch and support

          Stretch: Keep the photos in a table instead (chore, photo), so the app could show a history: that's how Data apps' A journal with drawings works.

          Support: Do Build 3's first sub-event together; pairs copy it for Feed and Homework.

          Where it leads

          Next: Creature stats. A variable that remembers which one (ForChore here, ClickedItem later) comes back whenever an app handles several things with one event.

          What each step is for