Skip to content

Latest commit

 

History

History
80 lines (51 loc) · 3.79 KB

lesson_34.md

File metadata and controls

80 lines (51 loc) · 3.79 KB

Lesson 3.4: Customization II: Reporters and predicates

Learning objectives

Students will be able to...

  • Build custom reporter and predicate blocks.

Material and preparation

Video resources

Pacing Guide

Duration Description
5 minutes Welcome, attendance, bell work, announcements
10 minutes Lecture and introduce activity
25 minutes Custom reporter activity
15 minutes Debrief and wrap-up

Instructor's notes

Lecture

Introduce reporter blocks

  • Ask students to find blocks with the reporter shape (round) and speculate as to what they do.
  • Point out familiar examples, such as:
    • x position block
    • answer block
    • pick random block

Explain the concept of reporting (returning) a value, and how reporter blocks are used to provide values to commands.

  • Emphasize that reporters do not (and should not) perform any action. They are used to compute values which are used by commands.

Introduce predicate blocks (as a special case of reporter blocks)

  • Emphasize that predicates must return true or false.
  • Point out examples, such as:
    • Touching Block
    • less than block
    • and block

Ask students why it might be useful to differentiate predicates from other reporters.

  • Only predicates can be used in a conditional.

Activity

Students should complete the "If my calculations are correct..." activity individually.

  • This lab consists of a series of independent custom blocks. The blocks need not necessarily be completed in the order given.
  • Work with students to ensure they are testing their blocks properly and reporting correct values.

Debrief

Ask a different student to provide their solution to each part. If time permits, go over multiple students' work for each part.

  • Point out differences and discuss advantages and disadvantages to different approaches.
  • Emphasize that custom blocks do not have to be long and complicated to be useful.

Accommodations and differentiation

Struggling students should focus on just the first 2 or 3 parts of the lab. Even if they cannot move on to the more difficult problems, getting used to defining custom reporters is helpful and important.

Advanced students who finish quickly can be utilized to assist other students or they can be challenged to complete the bonus problem using the distance formula.

If most students are not equipped to handle this math, a simpler computation, such as area of a triangle or average of three numbers, can be substituted.