Variables and logic

Finish only after students explore every part

Build a map students explore in any order, and use a router to send them back to the map until they've visited every part. The activity finishes on its own once they've seen them all.

Level
Intermediate
Time
About 15 min
Steps
7
Updated
Nov 21, 2026
What you'll build

A "Layers of the rainforest" activity where students visit the canopy, the understory and the forest floor in any order, and the activity ends by itself once they've seen all three.

Ready-made activity

Get the finished activity

Skip straight to the result, or keep it open beside the steps. Add this tutorial's activity to your account and explore how it works in the studio.

A map that students explore in any order is a great way to teach something with parts: the layers of a rainforest, the rooms of a castle, the planets. The hard part is the ending. A Finish button lets a student skip most of the map, and sending everyone to the ending after the last scene forces them into one order.

In this tutorial you'll let the activity decide. Every part ends with the same Back to the map button, and every one of those buttons goes to a router. A router is a decision the activity makes on its own, and students never see it. This one asks one question, "has this student seen every layer?", and sends them back to the map until the answer is yes. After that, it sends them to the ending.

You'll use the Storyboard throughout. If you haven't added a path from it before, Let students choose their own path is a gentler start.

Step 1: Build the map

Start from scratch: click New activity, name it Layers of the rainforest, then choose A blank activity and Build the first scene. On the Opening Scene:

  1. Give the scene a background: with nothing selected, open Background, click Choose a style, and pick Lagoon gradient under Gradients.
  2. Add a Heading that says Explore the rainforest.
  3. Add a Body text that says Visit all three layers, in any order. Once you've seen them all, you're done! Set its Font Size to 28 and make it Fixed width so it wraps onto two lines.
  4. Add three Buttons in a row. Click ⚙ Configure on each and set its Label to 🌳 Canopy, 🌿 Understory and 🍄 Forest floor.
  5. Rename each button after its layer: Canopy, Understory and Forest floor. Click the pencil next to the button's name at the top of the properties panel, type, and press Enter. The Storyboard lists buttons by name, so good names make the next steps easy.

Give the Closing Scene the same background too, and add a Body under its headline: You explored every layer of the rainforest. 🌳🌿🍄.

The Opening Scene on a teal-to-blue gradient: the heading Explore the rainforest, a line telling students to visit all three layers in any order, and three coral buttons for Canopy, Understory and Forest floor
The map. The buttons don't go anywhere yet.

The yellow 4 validation issues pill is Berdee's publish checklist, and the activity isn't finished yet. Click it any time to see what's left. It's clear by the time the activity is built.

Step 2: Give each layer its own scene

Click Storyboard at the top left. The Storyboard shows the activity as a board of cards, one for each scene, with a note under each saying what students do there and where it takes them. Click the Opening Scene card, then click Add what happens next in the panel on the right. A window asks What happens after 'Opening Scene'? and offers five choices:

One window makes the scene and the path to it.
  1. Choose A Next button. It's the choice for any button students tap to move on.
  2. Set What do they tap? to Canopy.
  3. Under Where do they go?, choose + A brand-new scene… and name the scene Canopy.
  4. Click Add path.
The A Next button window: a picture of the Opening Scene leading to Canopy on a tap on Canopy, What do they tap? set to Canopy, a note that adding this path turns off the scene's automatic move to the next scene, and Where do they go? set to a brand-new scene named Canopy
The note explains that tapped paths replace the scene's automatic move on.

Do the same twice more from the Opening Scene: a scene named Understory reached by tapping Understory, and a scene named Forest floor reached by tapping Forest floor. The Opening Scene's card now lists three ways out:

The Storyboard with the Opening Scene selected. Its card lists Tap Canopy, Tap Understory and Tap Forest floor, each going to its own new scene. The Canopy and Understory cards are blank and say Nothing here yet, and the top of the board says 3 things to do
Three paths out of the map scene. The board wraps and scrolls, so the Forest floor card is further down.

The three new scenes are empty, so each card says Nothing here yet and the top of the board says 3 things to do. The faint dotted lines to the Closing Scene are the path every new scene starts with, Right answer, which can't happen on a scene with nothing to answer. Leave each card's Add a Next button alone: these scenes get a Back to the map button of their own in the next step, and a router in Step 4.

Step 3: Fill in each layer

Click the Canopy card and press Edit scene in the panel. Build the scene:

  1. Give it the Lagoon gradient background, like the map.
  2. Add a Heading that says The canopy.
  3. Add an Image, set its size to 400 × 300 under Style & Layout, and drag it to the left. Click Choose image, search the stock photos for toucan, and pick one.
  4. Add a Body text to the right of the picture: A roof of leaves high above the ground. Most rainforest animals live up here, like this toucan. Set it to Fixed width at Font Size 26.
  5. Add a Button under the text, set its Label to 🗺️ Back to the map, and rename it Canopy back.
The Canopy scene: the heading The canopy, a photo of a toucan on a branch, a short fact about the canopy, and a coral Back to the map button
Every layer gets a picture, one fact, and a way back.

Click Storyboard to go back to the board, and build the other two the same way:

  • Understory: the heading The understory, a photo from a search for red eyed tree frog, the text Under the leaves it is shady, warm and damp. Tree frogs cling to the plants down here., and a 🗺️ Back to the map button named Understory back.
  • Forest floor: the heading The forest floor, a photo from a search for mushrooms forest, the text Hardly any sunlight reaches the ground. Mushrooms help fallen leaves rot away fast., and a 🗺️ Back to the map button named Floor back.

Name every Back button after its layer. All three say the same thing to students, but the Storyboard needs to tell them apart. Keep the names short: the board cuts off a long one.

Step 4: Send Back to the map to a router

Now the decision. On the Storyboard, click the Canopy card, then Add what happens next. This time, add a router instead of a scene:

Something else, then Different scenes for different students: that's a router.
  1. Choose Something else. The four choices above it are shortcuts for simple paths, and a router isn't one of them.
  2. Where do students go next? Choose Different scenes for different students and click Next. That's a router: it checks your rules and sends each student on, and students never see it.
  3. When do they leave 'Canopy'? Choose They tap something, set What do they tap? to Canopy back, and click Next.
The When step of the window, When do they leave 'Canopy'?: a picture of Canopy leading to Router 1 on a tap on Canopy back, with They tap something selected and What do they tap? set to Canopy back
The router runs the moment a student presses Back to the map.

The last step of the window, Who goes where?, is the router itself: its name, its rules, and where it sends everyone else.

One rule with three conditions, and an Otherwise.
  1. Name the router Seen every layer?.
  2. Click Add rule. Under Conditions, click Add Condition and choose Visits: Canopy. It starts on has been visited, which is what you want.
  3. Click Add Condition twice more and choose Visits: Understory and Visits: Forest floor. Leave the rule on All conditions are met, so it only matches once a student has been to every layer.
  4. Set the rule's Go to to Closing Scene. A new rule starts on the Opening Scene, so this one needs changing.
The Who goes where? step: the router named Seen every layer?, and Rule 1 with three conditions, Visits: Canopy, Visits: Understory and Visits: Forest floor, each has been visited
One rule, three conditions. All three have to be true.
  1. Set Otherwise to Opening Scene. It starts on whichever scene comes next in the activity's order, so check it. This is where students go when the rule doesn't match: back to the map, to pick another layer.
  2. Click Add path.
The foot of the window: Rule 1 goes to the Closing Scene, and Otherwise, When no rule matches, goes to the Opening Scene
Seen everything: the ending. Anything else: back to the map.

Why does this work, even for the layer a student is on? A visit counts the moment a student arrives on a scene. So when a student on their third layer presses Back to the map, that layer has already been visited, the rule matches, and they go to the ending.

The router gets a card of its own on the Storyboard, with its rule and its Otherwise listed on it. Click it to see the same in the panel:

The Storyboard with the Seen every layer? router selected. The Canopy card reads Tap Canopy back, going to the router. The router card lists one rule, If Canopy has been visited and Understory has been visited and Forest floor has been visited, going to the Closing Scene, and Otherwise going back to the Opening Scene. The top of the board says 2 things to check
Canopy leads to the router. Understory and Forest floor still need a way forward.

The dashed orange line is the rule: a path only some students take. The top of the board says 2 things to check, because Understory and Forest floor don't lead anywhere yet. The next step fixes both.

Step 5: Send the other Back buttons to the same router

One router can serve every layer. Click the Understory card, then Add what happens next:

Connect to the router you already made.
  1. Choose A Next button.
  2. Set What do they tap? to Understory back.
  3. Set Where do they go? to Router: Seen every layer?. A router you've made is in the same list as the scenes.
  4. Click Add path.
The A Next button window: a picture of Understory leading to the Seen every layer? router on a tap on Understory back, What do they tap? set to Understory back, and Where do they go? set to Router: Seen every layer?
Pick the router from the same list as the scenes.

Do the same from the Forest floor card with Floor back.

Step 6: Tidy up and check the Storyboard

Click each layer's card and look at Where students go next in the panel. A layer may still list Right answer (not working yet: nothing to answer) beside its Back path; you can see one on the Canopy card in Step 4's picture of the router. It's left over from adding the scene. It would never happen, since there's no question on these scenes, but a clean board is easier to check. Press Change next to it, then Remove path.

Here's the finished activity, with the router selected. Each button on the map scene opens its layer, every layer's Back button leads to the router, and the router either goes back to the map scene or opens the ending. The top of the board says Everything connects:

The finished Storyboard with the Seen every layer? router selected, scrolled down so the Understory and Forest floor cards, the router and the Closing Scene are in view. Each layer's Back button leads to the router, the router's rule leads to the Closing Scene along a dashed orange line, and its Otherwise goes back to the Opening Scene. The panel lists Canopy, Understory and Forest floor under How students get here, and the top of the board says Everything connects
Three layers, one router, one way to the ending. Canopy is just out of view; scroll the board to see it.

Step 7: Explore it as a student

Click Preview at the top of the Storyboard. It starts at the Opening Scene, even when another scene is selected on the board. Visit one layer and come back:

One layer seen, two to go, so the router sends the student back.

Tap 🌳 Canopy:

The Canopy scene in preview, with the toucan photo, the fact, and the Back to the map button
What a student sees on the first layer.

Press 🗺️ Back to the map. The router checks its rule, finds two layers still unvisited, and uses Otherwise, so the student is back on the map:

The map again in preview, with all three layer buttons
Back on the map, free to pick any layer, including one they've already seen.

Visit 🍄 Forest floor and come back the same way. Then visit the last one, 🌿 Understory, and press Back to the map. This time every condition is true, and the router goes to the ending instead:

The same button, a different place: the last layer opens the ending.
The Closing Scene in preview: You finished the activity! and You explored every layer of the rainforest, on the gradient
Three layers seen, so the activity finishes.

Try a different order with Restart at the top right. Whichever layer a student sees last, its Back button is the one that opens the ending. A student who revisits a layer they've already seen goes back to the map as usual.

What you built

You built an activity that finishes only when a student has explored all of it:

  • a map scene with one Button per layer, each with a They tap something path to its own scene,
  • a Back to the map button on every layer, named after its layer,
  • one router, Seen every layer?, that every Back button leads to,
  • a rule with three Visits: … has been visited conditions that goes to the Closing Scene, and
  • Otherwise back to the map.

To add a fourth layer, add its scene and Back button, connect the button to the router, and add one more Visits condition to the rule. You can also ask for less: switch the rule to At least one condition is met, or check the router's own visits (Visits: Seen every layer? (router), visit count is at least 2) to end after any two stops. To put the same Back button on every scene without building it three times, see Share working buttons across scenes with a layout. Avoid sending students back to a scene with a question they've already checked: their answers stay locked there.

Take it with you

Make this activity yours

Add the activity you just watched being built to your account, then change it for your class: your questions, your pictures, your colors.

Was this tutorial helpful?

Next tutorial