Skip to content
Computing · Year 7

Active learning ideas

Introduction to Functions and Procedures

Active learning works well here because students need to see the immediate payoff of modular coding. Defining, calling, and testing custom blocks in Scratch lets pupils experience firsthand how functions streamline repeated tasks, which builds confidence and clarity in programming logic.

National Curriculum Attainment TargetsKS3: Computing - Programming and Development
30–45 minPairs → Whole Class4 activities

Activity 01

Peer Teaching30 min · Pairs

Pair Programming: Custom Movement Block

Students work in pairs to create a 'moveForward' custom block with distance and speed parameters. They test it by calling the block multiple times in a sprite script, then swap roles to modify and debug. Pairs combine blocks into a simple obstacle course.

Explain the benefits of using functions to organize code.

Facilitation TipDuring Pair Programming, circulate and prompt pairs to verbalize each step as they define the block and add the call, reinforcing the link between definition and execution.

What to look forProvide students with a simple Scratch project that repeats a sprite movement three times. Ask them to rewrite the project using a custom block for the movement and explain in one sentence why this is better.

UnderstandApplyAnalyzeCreateSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Peer Teaching45 min · Small Groups

Small Groups: Reusable Game Functions

Groups design three custom blocks: score update, enemy spawn, and sound effect. Each member codes one block, then they integrate into a shared game project. Groups present how functions reduce code length and fix issues collaboratively.

Design a custom block in Scratch to perform a specific task.

Facilitation TipFor Reusable Game Functions, provide a starter project with duplicated code so groups can directly compare the original and refactored versions, making the benefits of modularity visible.

What to look forDisplay two Scratch scripts side-by-side: one with repeated code and one refactored using a custom block. Ask students to identify which script uses a function and explain one benefit they observe.

UnderstandApplyAnalyzeCreateSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Peer Teaching35 min · Whole Class

Whole Class: Function Refactoring Challenge

Display a long, repetitive Scratch script on the board. As a class, identify repeatable sections and vote on custom blocks to create. Students then replicate and refactor individually on their computers, comparing before-and-after code.

Analyze how functions improve code readability and maintainability.

Facilitation TipIn the Function Refactoring Challenge, assign roles within groups so every student contributes: one refactors, one tests, one records benefits, ensuring active participation and accountability.

What to look forPose the question: 'Imagine you are building a robot that needs to draw a square multiple times. How would using a custom block (function) help you design the code for this robot, and what information might you need to give the block each time it draws a square?'

UnderstandApplyAnalyzeCreateSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Peer Teaching40 min · Individual

Individual: Personal Procedure Portfolio

Each student builds five custom procedures for everyday tasks, like drawing shapes or checking conditions. They document inputs, outputs, and usage in a digital portfolio, then self-test by calling blocks in new projects.

Explain the benefits of using functions to organize code.

Facilitation TipHave students in the Personal Procedure Portfolio include a short reflection on one block they created, describing what it does and why they named it that way, to strengthen metacognition.

What to look forProvide students with a simple Scratch project that repeats a sprite movement three times. Ask them to rewrite the project using a custom block for the movement and explain in one sentence why this is better.

UnderstandApplyAnalyzeCreateSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teachers should model naming conventions and parameter use before students create their own blocks. Start with simple, single-purpose procedures so students grasp the concept of encapsulation before tackling more complex inputs. Avoid skipping the step of calling the block explicitly in a script; this is where many misconceptions about execution begin. Research shows that students learn modularity best when they repeatedly see the same task performed both ways—once duplicated, once refactored—so plan comparisons that make the difference obvious.

By the end of these activities, students will confidently define custom blocks, pass parameters, and call them from scripts. They will also explain how reusable blocks improve readability, reduce repetition, and make projects easier to maintain and debug.


Watch Out for These Misconceptions

  • During Pair Programming, watch for students who assume their custom block runs automatically once defined.

    Prompt pairs to trace the script step-by-step and add a call block explicitly. Ask them to predict what will happen before running the code, then explain why the block only executes when called.

  • During Reusable Game Functions, watch for students who believe functions without parameters have no value.

    Have groups measure the number of duplicated lines before and after refactoring. Ask them to discuss in their small groups whether the fixed 'jump' animation improves readability and why fixed tasks still benefit from modular design.

  • During Function Refactoring Challenge, watch for students who think functions make code harder to read.

    After refactoring, have each group present their renamed blocks and explain how the new names clarify the script’s purpose. Use a gallery walk so students see multiple examples of clear, modular naming.


Methods used in this brief