Approved Training Module For Coding in Grade 5 2023
Approved Training Module For Coding in Grade 5 2023
SCHOOL TEACHERS
09 JUN 2023
CEO, CEMASTEA
Citation
Acknowledgment
The CEO of CEMASTEA would like to thank the following staff for their input in the
development of this module.
1. Jacinta Akatsa -CEO
2. Makoba Kizito
3. Martin Mungai
4. George Kiruja
5. Nancy Nui
6. Francis Kamau
7. Philip Maate
8. Richard Jakomanyo
9. Clotilda Nyongesa
10. Rahab Chiira
11. Agnes Mwangi
12. Dr. Njoroge Mungai
13. Clara Mwangi
14. Esther Kamenwa
15. Lucy Mwaniki
16. Paul Lomosi
Rationale
The Science and Technology curriculum designs for grades 4 and 5 and the baseline
study by CEMASTEA (2022) served as the foundation for the content of this module.
The creation of this module will enable teachers to acquire instruction in the
fundamentals of coding.
Welcome to Section One of this Module. This section will equip you with the knowledge
and strategies needed in learning coding. In today’s digital era, coding has become an
essential skill for children. To make the learning process engaging and enjoyable,
exciting activities that combine game puzzles and mazes are used to introduce the
learners to basic coding skills.
Reflection 1
Share your favorite childhood games and toys, and briefly discuss why you enjoyed.
You will realize that it is all connected to creativity, problem solving and playfulness.
Reflection 2
Share the strategies you used to make others learn the game.
Effective teaching strategies you may have mentioned:
o Providing clear simple instructions
o Incorporating demonstrations (Hands on activities)
o Encouraging creativity and self-expression
o Offering scaffolding and guidance
https://www.jspuzzles.com/en/transportation/vehicle/truck/pickup-truck/2459888
Start
Here 3 8 12
9 7 10 6
1 2 4 15
End
Here
5 11 13
Task 3
In the grid fill in the missing numbers using; 1,2,3,4. No number should be repeated
horizontally or vertically.
3 1
Young children are curious and enjoy exploring and experimenting. A playful approach to
coding taps into their innate sense of play and makes the learning experience enjoyable.
Creativity, logical thinking, problem-solving, and playfulness are essential elements in
coding.
What is coding?
Coding can be defined as the process of developing and implementing various sets of
instructions to enable a computer to perform a certain task, solve problems, and provide
human inter-activity (Balanskat & Engelhardt, 2014).
What is programming?
Programming is giving instructions to a computer or a device to perform specific tasks or
solve problems. It involves writing a series of step-by-step instructions called codes that
tell the computer what to do. Just like we use words to communicate with other people
we use codes to communicate with computers.
Activity
Click the link https://scratch.mit.edu/projects/394885714/fullscreen/ and observe the
animation. Describe your observation.
green flag icon to play the animation. Observe what happens and describe your
observation.
Maze game
.
Block palette: This contains instruction blocks (code blocks) used to program the sprite
to do or say something.
Coding area: This is the space where the code blocks are dragged and dropped as you
write a program(story/games).
Sprite area: This is the area or space where the selected sprites appear and can be
interchangeably controlled for display in the coding area. It defines the boundaries within
which the sprite can move and interact with other objects. It is represented by a
rectangular shape that encloses the sprite's image or costume
Stage: This is the primary area where the action of the program is displayed as performed
by the sprite. The stage may be of different backgrounds.
Motion Blocks:
These blocks in Scratch are used to move or turn sprites around the stage. For example:
Looks Blocks:
These code blocks are used for the purpose of controlling a sprite’s appearance (size,
costume, or visibility). They are also used to add speech bubbles and change the
backdrop.
Sound Blocks:
These code blocks are useful in adding music and sound effects. For example,
Control Blocks:
Control blocks are used in Scratch to give certain conditions. Some of the commonly
used control blocks are as shown below.
Repeat Blocks and If then else Block:
For example, we can select the sprite as indicated in the diagram below and see how it
changes on the stage area.
Browse the Backdrop library: In the backdrop library, you'll find various categories and
options. You can choose from
Activity 1
a) Using the ‘choose a sprite’ icon, select a different sprite of your choice for your
project.
Introduction
Welcome to animation in sscratch. In this section, we will focus on how to animate and
create an animated project based on pertinent and contemporary issues (PCIs).
Reflection
1. What is animation?
2. What are some of the area where animations are applicable?
You may have come up with the following;
Animation is the process of manipulating still figures (sprites in scratch) to create
the illusion of movement. In scratch programming, sprites (icons) are manipulated
to create a combination of live action.
Animations are applied in various areas such as; education, entertainment and
gaming, advertisement and marketing, architecture and engineering.
Animation can be applied to facilitate learners’ understanding of various aspects
outlined in the Competence Based Curriculum (CBC), such as Pertinent and
Contemporary Issues (PCIs).
The process of creating an animation by learners can harness the core
competencies, such as creativity and imagination.
How to animate
Animation in scratch programming can be summarized
into two major steps.
I. Storyboarding consists of imagining and
creating a series of actions to be illustrated by
the sprite.
II. Programming the sprites to illustrate the
actions.
Figure 1 indicates the spiral of creative learning by
Resnick (2007), which shows the interaction between
the two steps.
Imagine
Reflection
Make the Sprite cat to say ‘Jambo’ and Change the backdrop and make the cat to
move around on a blank backdrop turn and Jump
Create
Reflection
● How do you animate the sprites based on the imagination above?
This involves writing commands to actualize the intended action as outlined on the
storyboard. The commands can be adjusted to reflect changes made progressively on the
storyboard.
Step 1: Make the Sprite cat to say ‘Jambo’ and move around on a blank backdrop
Open Scratch by double-clicking on the scratch icon on the computer's desktop.
On the left-hand side of the Scratch interface in the Blocks palette section, click on the
Event category
Drag and drop the following code block into the Script Area.
Click on the Motion category
Drag and drop the ‘move’ code block on the script area
Click inside the text area written ‘10’ steps and change the number of steps to ‘70’
Attach the block to the previous two block commands as shown below
Click the Green Flag on the top left-hand side of the screen and observe what
happens to the cat sprite.
Drag and drop the ‘wait’ code block and attach to existing code block
Drag and drop three more ‘move’ code blocks and adjust the number of steps to 20, 40,
and 50 as shown in the code block below.
Drag and drop the ‘go-to’ code block on the script area
The code block has different X and Y coordinates depending on the position of ‘the cat’
on the stage. It allows one to position the sprite at different points on the stage.
The stage is partitioned into two sets of coordinates: the X-axis represents the horizontal
position, and the Y-axis represents the vertical position.
Move ‘the’ cat randomly to different positions on the stage and observe how the X and Y
coordinate change on the block palette.
Add the ‘go-to’ code block after the ‘when-clicked’ code block to bring the cat back to
the point of preference on the stage area.
Step 2: Change the backdrop and make the cat to turn and Jump
Go to stage at the bottom left and click on the new Backdrops icon located under the
Stage icon
Drag and drop the ‘go-to’ code block on the script area to place the cat on the ground
Now let's make ‘the cat’ to turn then jump up and down
The cat will turn to face the opposite direction as shown below.
Move ‘the cat’ sprite at the top of the stage area. The X and Y coordinate will change
accordingly as observed in the motion area.
Drag and drop the ‘glide’ code block on the script area.
Move ‘the cat’ sprite at the bottom of the stage area. The X and Y coordinate will change
accordingly as observed in the motion area.
Note the Y coordinate has changed to a negative. Click on the green flag and observe
what happens
To make the cat jump up for a specific number of times, click on the Control category
Let’s now save our project. Click on the file menu at the top right of the screen
On the left-hand side of the dialog box, choose the location to save your project in this
case, the Desktop.
Click on the Desktop option and create a folder named My Projects.
A dialog box will appear, click on the desktop and locate your folder My Projects
The ‘Avery Walking’ icon is highlighted in blue, showing that the Sprite is active.
Let us now code ‘the cat’ to take a walk with ‘Avery Walking’ as they have a chat.
Drag and drop the ‘when- clicked’ block code in the Script area.
On the Looks category, we have the ‘show’ and ‘hide’ code blocks.
These code blocks will hide ‘Avery Walking’ so that she appears on the stage after ‘the
cat’ has completed its jumps.
Add a ‘wait’ code block to input the number of seconds ‘Avery Walking’ will wait before
appearing. The number of seconds depends on how long ‘the cat’ code program takes.
1. ‘Avery Walking’ will appear as if she is floating, add the X & Y coordinate block
to place her on the ground.
2. Turn ‘Avery Walking’ to face the same direction as the cat.
Now let's get Avery to say “it’s a beautiful day cat!’
While still on code for ‘Avery Walking’, click on the Looks category.
Click in the input box and change from ‘Hello!’ To ‘It's a beautiful day cat!’
Click the Green Flag on the top left-hand side of the screen and observe what happens.
On the Sprite List section, click on the ‘Avery Walking’ icon to activate it
Click on the Size input box. Change from 100 to 120. Observe what happens.
We will be clicking the Green Flag on the top left-hand side of the screen and observe
what happens to the animation we have created.
Project task
Create a storyboarding on any of the following Pertinent and Contemporary Issues (PCIs)
for animation:
1. Climate change
2. Affordable housing
3. Care for the environment and animals
Or any other of your choice
Additional Learning Resources
The following two links can be used to support learners on the CBC sub-strands on care
for the environment and animals.
● Tree simulator: https://youtu.be/St244bVXC-c
● How to make a virtual pet: https://youtu.be/irhNLRWwhv0
Introduction
Scratch games promotes learner’s computational thinking, creativity, and problem solving
skills. Further, it promotes communication and collaboration as learners work in groups.
Learners can use Scratch to create their own stories, games, and animations, and share
with others. Scratch introduces the learners programming.
Scratch enhances learner’s high order thinking skills as they come up with creative
solutions to problems. Coding enables learners to figure out how to break down complex
ideas into smaller manageable parts. As learners make games, animations, or stories, they
have to figure out how various parts of their coding can work together. This develops
their problem-solving skills that can be applied to other areas of their daily life.
Imagine
We are going to create a maze game using scratch application. First we will sketch on a
piece of paper a maze with a clear path from start to exit. We will use the sketch to draw
the maze on a canvas on scratch application with the help of your mouse pointer.
We will code two sprites; a Sprite 1 the cat and a packet of milk. The goal is to make the
‘cat’ sprite move along a path in the maze till it reaches the ‘milk’ sprite. For this game
we wanted the ‘Milk’ to make a sound when ‘Sprite 1’ touches ‘milk’. The code block to
use will include the Motion, Looks, Sound, Control, Sensing and Events.
The sensing blocks will be used to tell or highlight how sprites interact with their
surroundings. The broadcast block will broadcast messages to let one part of the code or
project communicate with another part. An if-then block code will be used to ensure that
the sprite only uses the designated path to the milk. A forever code block will be used to
repeat the sequence of commands to ensure the continuity of the game.
Create
Let’s now create the maze and code the maze game.
1. How create the maze
On a piece of paper sketch a maze with a clear path from start to exit.
Remember in Scratch the default sprite is a cat. Choose the second sprite ‘Milk’
Change the sprites position using x and y coordinates for the sprite to move in the
different directions
a. Right arrow
c. Down arrow
d. Up arrow
Drag and drop the following block into the Script Area.
Drag and drop on the Script Area the command that says Hello for two seconds. Replace
the word ‘Hello!’ with ‘I need milk!’
Drag and drop the ‘go-to’ code block on the script area
Click the Green Flag on the top left-hand side of the screen and observe what happens.
Activity: Can you tell what ‘the cat’ is expected to do from the following code?
Drag and drop a second ‘when- clicked’ block into the Script Area
Drag and drop the ‘touching color’ code block on the ‘if-then’ code block
Move the mouse cursor on the maze. A magnifying glass will appear, click on any line of
the maze. The color on the code will change to reflect the color of the maze.
Drag and drop the ‘forever’ code block to encapsulate the ‘if-then’ code block
Click the Green Flag on the top left-hand side of the screen and observe what happens.
Let's add one more condition to control the use of a mouse pointer.
Drag and drop a third ‘when- clicked’ block into the Script Area
Add the ‘if-then’ code block
Drag and drop the ‘touching mouse-pointer’ code block on the ‘if-then’ code block
Drag and drop the ‘go to x: y’ code block inside the ‘if-then’ code block. This will
restrict moving ‘the cat’ using a mouse pointer.
Insert the ‘forever’ code block inside the ‘if-then’ code block
Drag and drop a second ‘when I receive’ code block into the Script Area
Click the Green Flag on the top left-hand side of the screen and observe what happens.
Now let’s Play with the game, explore and test the boundaries of the game.
Project task
Imagine new game ideas you can create. Draft the ideas in a storyboard then create a
game on any of the Pertinent and Contemporary Issues (PCIs)
Suggestions:
● Equality Puzzle: Design a puzzle game that promotes diversity and inclusion.
● Food Waste Challenge: Create a game that educates players about the issue of food
waste.
In this section we are going to discuss how to use scratch to find a solution to a problem
in your local environment.
Example
A primary school is located along a busy highway.
Learners cross this road to access the school in
the morning and in the evening while going
home. The problem is how to guarantee the safety
of learners while crossing the busy highway.
Solution
Safety rules/ steps that learners can follow while crossing the road.
Steps/ rules that learners can follow:
a. Move to the road edge and stop
b. Check left, right and left again before crossing
c. Look around while crossing to spot any oncoming car or motorbike
d. If the road is clear, then cross.
Trial code to solve the problem using paper
Manila papers can be used to form blocks labeled with instructions that will be used to
solve the problem. The instructions need to be arranged in a logical manner as follows:
Activity 1
a) In groups discuss and name one problem found in your environment.
b) In your note books, write, draw, and describe how you will solve the problem.
Activity 2
Solving your problem with scratch
In the previous activity, you identified a problem and came up with a solution, you then drew
code blocks needed to solve the problem.
a) Using your drawings, find the code blocks on scratch and drag them to the code
area.
b) Your code should have at least one block from the Motion, looks, sound, events
and control button
Arrange your code blocks in a logical way and make any changes you need to m
ake.
We hope that this module had enabled you to improve your efficacy to teach codingto
your learnrs.
Resnick, M., Maloney, J., Monroy-Hernández, A., Rusk, N., Eastmond, E., Brennan,
K., ... & Kafai, Y. (2009). Scratch: programming for all. Communications of the
ACM, 52(11), 60-67.
Balanskat, Anja, and Katja Engelhardt. 2014. Computing Our Future: Computer
Programming and Coding-Priorities, School Curricula and Initiatives across
Europe. European Schoolnet.
World bank 2019. Chidren learning to code: Essential for 21st Century Human Capital