< Course C (2021)

Lesson 11: The Big Event

45 minutes

Overview

In this context-setting lesson, students will learn that events are a great way to add flexibility to a pre-written algorithm.

Purpose

Today, students will learn to distinguish events and actions. The students will see activities interrupted by having a "button" pressed on a paper remote. When seeing this event, the class will react with a unique action. Events are widely used in programming and should be easily recognizable after this lesson.

CSTA K-12 Computer Science Standards (2017)
    • 1A-AP-09 - Model the way programs store and manipulate data by using numbers or other symbols to represent information.
    • 1A-AP-11 - Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions.

Agenda

Objectives

Students will be able to:
  • Practice differentiating pre-defined actions and event-driven ones.
  • Recognize movements of the teacher as signals to initiate commands.
  • Repeat commands given by an instructor.

Preparation

  • Print or display the *Event Controller.
  • Print one *assessment for each student.
  • Make sure every student has a reflection journal.

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the teachers
For the students

Vocabulary

  • Event - An action that causes something to happen.

Teaching Guide

Warm Up (15 minutes)

A Series of Events

Say: Let’s see if we can find a pattern here:

  • When you flip a switch, the lights turn on.
  • When you tap on a device, an app starts.
  • When the alarm goes off, you get out of bed.
  • When (event), (action).

In computer science, events cause other actions to happen. Our new vocabulary word today is event. Normally when we hear “event” we think of:

  • Field trip
  • Competition
  • Birthday Party

We’re learning a new meaning for the word "event" today. Let's focus on "events" that cause other actions to happen like when flipping a switch causes the lights to turn on or pressing a button to make a character in a game move.

Vocabulary

This lesson has one new and important vocabulary word:

Event - Say it with me: E-vent.

An event is an action that causes something to happen.

Main Activity (15 minutes)

  • Do you remember guiding Red from "Angry Birds" to the pig in the Maze puzzles?
    • In that exercise, you knew in advance exactly where you wanted Red to go, so you could make a program that took Red from start to finish without any interruptions.
    • In most real programs, we can't do that because we want to have options, depending on what the user needs.
      • Say that I only want my character to move when my finger is on the screen of my phone. I would need to program the character to only move when I put my finger on the screen of my phone.
      • Putting my finger on the screen would then become an event that tells my character to move.

In earlier lessons, we created algorithms that allowed us to control a friend or other character for several steps at a time. It was fun and useful, but what happens when you don’t know everything that you want your friend to do in advance? This is where events come in!

Teaching Tip

If your students seem confused, talk about their favorite games and all of the ways that they let the characters know what they're supposed to do. Point out how the game would be really boring if it ran from start to finish without any events required.

Directions:

  • Project the *Event Controller onto your classroom screen.

  • Decide with your class what each button does. We suggest:
    • Green Star -> Clap
    • Orange Triangle -> Hands in the air
    • Blue Hexagon -> Hands on hips
    • Purple Circle -> Twist
    • Pink Rectangle -> Stomp
  • Practice tapping the buttons on the screen and having your class react.
  • Add some button sequences into the mix and have the students try to keep up with their actions.
  • Let your class know that every time you push a button, it is an event that lets them know what they are expected to do next.
  • To make things more challenging, get the class started on a separate task, then begin interrupting them again with the buttons. We suggest:
    • Counting to 10
    • Singing “Old MacDonald”
  • Practice until students seem comfortable with the idea that each button press causes them to perform an action.

Wrap Up (15 minutes)

Reflection (10 minutes)

Prompts:

  • What did we learn?
  • What are some examples of events?
Teaching Tip

Students should demonstrate understanding that events are something that can cause other actions to happen. Refer back to earlier examples from the lesson or encourage students to come up with their own.

Assessment (5 minutes)

  • Hand out *Assessment and allow students to complete the activity independently after the instructions have been well explained.
  • This should feel familiar, thanks to the previous activities.

Extended Learning

Use these activities to enhance student learning. They can be used as outside of class activities or other enrichment.

One Person's Event is Another One's Action

  • Assign each student an event to watch out for, and an appropriate reaction to that event. Chain the actions so that each child's action becomes an event that triggers the reaction of another student. Keep assigning until everyone has something to do and everyone makes someone react.

Eventopalooza

  • Break the class up into groups. Using the Events Controller, assign each group a different reaction to the same button. Do this for all three buttons, then watch the chaos!
Creative Commons License (CC BY-NC-SA 4.0).

This work is available under a Creative Commons License (CC BY-NC-SA 4.0).

If you are interested in licensing Code.org materials for commercial purposes contact us.