Skip to content
Computing · Year 3

Active learning ideas

Conditional Statements: If/Then Logic

Active learning works for conditional statements because students need to experience cause-and-effect firsthand. When they see a sprite respond to a key press or edge detection, the abstract concept of 'if-then' logic becomes concrete and memorable. Hands-on activities transform confusion into clarity by letting students debug and refine their own conditions.

National Curriculum Attainment TargetsKS2: Computing - ProgrammingKS2: Computing - Logical Reasoning
20–35 minPairs → Whole Class4 activities

Activity 01

Pair Programming: Edge Detection Challenge

Pairs log into Scratch Juniors and program a sprite to move forward. Add an 'if touching edge, then turn' condition. Test runs, swap roles to debug partner's code, and share successes with the class.

Explain how an 'if-then' statement allows a program to make decisions.

Facilitation TipDuring Pair Programming: Edge Detection Challenge, circulate and ask partners to explain why their sprite reacts only at the edge, not elsewhere on the screen.

What to look forProvide students with a simple 'if-then' code block (e.g., 'if touching color blue, then say Hello'). Ask them to draw what the sprite would do if it touched the color blue, and what it would do if it touched the color red.

RememberUnderstandAnalyzeSocial AwarenessSelf-AwarenessDecision-Making
Generate Complete Lesson

Activity 02

Outdoor Investigation Session35 min · Small Groups

Small Groups: Key Press Game

In small groups, create a sprite that jumps if the spacebar is pressed using 'if key pressed, then jump'. Add a second condition for colour change. Groups demo their games and vote on the most creative.

Compare a program with conditions to one that simply follows a sequence.

Facilitation TipIn Small Groups: Key Press Game, remind students to test each condition with different inputs before claiming their game works.

What to look forPresent two short programs: one that makes a sprite move forward 10 steps, and another that makes a sprite move forward 10 steps only if the space bar is pressed. Ask students: 'What is the difference in how these programs will run? Which one is more like a set of instructions for making a sandwich, and why?'

RememberUnderstandAnalyzeSocial AwarenessSelf-AwarenessDecision-Making
Generate Complete Lesson

Activity 03

Outdoor Investigation Session25 min · Whole Class

Whole Class: Traffic Light Simulation

Project a shared program. Class votes on conditions like 'if red light, then stop'. Students suggest tweaks, then replicate individually on tablets. Discuss why conditions make it realistic.

Construct a simple program where a sprite changes behavior based on a condition.

Facilitation TipFor Whole Class: Traffic Light Simulation, pause the activity after each step to have students predict what will happen before revealing the outcome.

What to look forDuring a coding activity, ask students to hold up a green card if they have successfully made their sprite change color when it hits the wall, and a red card if they are stuck. Then, ask them to explain the 'if' part of their code.

RememberUnderstandAnalyzeSocial AwarenessSelf-AwarenessDecision-Making
Generate Complete Lesson

Activity 04

Outdoor Investigation Session20 min · Individual

Individual: Sprite Decision Tree

Each student builds a choose-your-own-adventure for a sprite: if click left, go one way; if right, another. Test against checklist of conditions, then peer review one.

Explain how an 'if-then' statement allows a program to make decisions.

Facilitation TipDuring Individual: Sprite Decision Tree, ask students to sketch their decision paths before coding to reinforce logical planning.

What to look forProvide students with a simple 'if-then' code block (e.g., 'if touching color blue, then say Hello'). Ask them to draw what the sprite would do if it touched the color blue, and what it would do if it touched the color red.

RememberUnderstandAnalyzeSocial AwarenessSelf-AwarenessDecision-Making
Generate Complete Lesson

A few notes on teaching this unit

Experienced teachers approach this topic by starting with physical analogies, like traffic lights or simple games, before moving to code. They avoid rushing to abstract explanations and instead let students discover the need for conditions through trial and error. Research suggests that using visual flowcharts alongside code helps students grasp decision branches more effectively than text alone. Teachers should also model debugging by intentionally creating incorrect conditions and asking students to identify why the sprite isn’t responding as expected.

Successful learning looks like students confidently writing conditions that match specific states and actions. They should explain why a sprite moves only when a condition is true, and adjust code based on testing outcomes. Group discussions should include reasoning about true and false outcomes in their programs.


Watch Out for These Misconceptions

  • During Pair Programming: Edge Detection Challenge, watch for students who think the sprite will always react to the edge, regardless of its position.

    Prompt partners to test the sprite at different screen positions and ask them to describe when the condition evaluates to true. Encourage them to adjust their code until the sprite reacts only at the edge.

  • During Small Groups: Key Press Game, watch for students who assume the 'then' action happens no matter what key is pressed.

    Have the group list all the keys they tested and which ones triggered the sound. Ask them to adjust their condition to include only the intended key.

  • During Individual: Sprite Decision Tree, watch for students who create sequences without conditions, assuming the sprite will always follow the same path.

    Ask them to compare their program to a linear sequence and explain how conditions add flexibility. Guide them to add at least one condition that changes the sprite’s behavior based on input.


Methods used in this brief