Skip to content
Computing · Year 4

Active learning ideas

Conditional Logic: If/Then Statements

Active learning works for conditional logic because students must physically or visually step through each branch to see how decisions change program behavior. Moving beyond abstract examples lets learners test predictions in real time, building confidence in how 'if/then' rules control outcomes.

National Curriculum Attainment TargetsKS2: Computing - Programming and Algorithms
25–45 minPairs → Whole Class4 activities

Activity 01

Simulation Game30 min · Pairs

Unplugged: Robot Commands Sort

Print cards with robot actions and conditions like 'if floor wet, then jump'. Students in pairs sort cards into sequences, predict robot paths on a grid mat, then act as robots to test and adjust. Discuss why some paths fail.

Predict how a program will behave with an 'if/then' statement.

Facilitation TipDuring Robot Commands Sort, ask students to verbalize each decision aloud before placing the command card to reinforce the link between condition and action.

What to look forProvide students with a simple scenario, such as 'If the player touches a coin, then add 10 points.' Ask them to write down what the condition is and what the action is. Then, ask them to describe what happens if the player does not touch a coin.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 02

Simulation Game45 min · Pairs

Block Coding: Sprite Decision Maze

Using Scratch or similar, students code a sprite to move forward but turn if touching a wall color. Pairs build mazes, swap codes to test, and predict outcomes before running. Refine based on peer feedback.

Design a program that uses a condition to change its actions.

Facilitation TipBefore running Sprite Decision Maze, have students sketch the expected path on mini-whiteboards to strengthen prediction and comparison skills.

What to look forShow students a short block-based code snippet with an 'if/then' statement (e.g., 'if touching color blue, then say 'Hello''). Ask them to predict what the program will do when run. Then, run the code and ask them to explain any differences between their prediction and the actual outcome.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 03

Simulation Game25 min · Whole Class

Whole Class: Conditional Story Chain

Teacher starts a story program on the board with an 'if/then'. Class votes on conditions, adds blocks sequentially, and predicts story branches. Run the program to reveal outcomes and vote on revisions.

Explain the purpose of a conditional statement in everyday life.

Facilitation TipIn Conditional Story Chain, pause the chain after each conditional turn to ask, 'What would happen if we changed the condition to...?' to build flexibility in thinking.

What to look forAsk students to think about a common household appliance, like a microwave. Prompt them: 'What is one 'if/then' rule that the microwave follows? For example, 'If the timer is set and the start button is pressed, then begin cooking.' Discuss their examples and how the appliance behaves differently based on these conditions.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 04

Simulation Game35 min · Small Groups

Small Groups: Debug Challenge Relay

Groups receive buggy 'if/then' code printouts for a game. One student fixes a condition per turn, passes to next, predicts full behavior. Test digitally and share fixes with class.

Predict how a program will behave with an 'if/then' statement.

Facilitation TipFor Debug Challenge Relay, set a timer so teams feel pressure to articulate each fix before passing the next card.

What to look forProvide students with a simple scenario, such as 'If the player touches a coin, then add 10 points.' Ask them to write down what the condition is and what the action is. Then, ask them to describe what happens if the player does not touch a coin.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

A few notes on teaching this unit

Start with unplugged games so students embody the role of the program. Use consistent color-coding for 'if' (green) and 'else' (red) to build automatic recognition. Avoid rushing to code; let errors surface in the physical or block-based model so students see why order and clarity matter. Research shows that multiple modes—acting, drawing, and coding—strengthen understanding of logic flow.

By the end of these activities, students will confidently trace, write, and explain 'if/then' statements, showing they can predict program flow, debug misplaced conditions, and connect logic to familiar systems like games or traffic lights.


Watch Out for These Misconceptions

  • During Robot Commands Sort, watch for students who place both 'if' and 'else' command cards into the same sequence, assuming both actions always run.

    Guide students to physically separate the path into two branches after the condition card, then have a peer walk each path to confirm only one outcome is possible.

  • During Debug Challenge Relay, watch for students who rearrange condition blocks without predicting the new outcome first.

    Before touching the code, ask each team to write on a sticky note what they expect to happen after the swap, then test and compare predictions to the actual result.

  • During Sprite Decision Maze, watch for students who treat conditions as static labels rather than inputs that change during play.

    Insert a live demo where you move the sprite by hand while students call out whether the condition is true or false, showing how user input drives the logic.


Methods used in this brief