How to use the
Learning Portal

Learning Portal

Our hands-on, comprehensive lesson plans span a range of levels. Browse our free STEM and coding learning resources.

Marty Image

Cracking the Code - Security & ELA

60 Minutes

Lesson Overview

Learners will need to write a short scenario for a situation where they need to use a password or code. They will then need to devise a secret combination of notes that will unlock a routine for Marty that they will need to write. Additionally, learners will need to write what happens in the event of an incorrect code.

The goal of the lesson is to have Marty react to a combination instead of a single input.

Key vocabulary:
    Broadcast, code, password, if then,

Content Sections

  • Learning Objectives
  • Pre-lesson preparation
  • Warm-up
  • Get learning
  • Time for Practice
  • Cooldown
    • Extensions & Challenges
    • Extension
    • Support
    • Additional Reading
    • Cracking the Code - Security & ELA

      60 Minutes

      Lesson Overview

      Learners will need to write a short scenario for a situation where they need to use a password or code. They will then need to devise a secret combination of notes that will unlock a routine for Marty that they will need to write. Additionally, learners will need to write what happens in the event of an incorrect code.

      The goal of the lesson is to have Marty react to a combination instead of a single input.

      Key vocabulary:
        Broadcast, code, password, if then,
      • Awareness of if statements, experience with ‘broadcasting’ messages.
      • Marty the Robot V2, Device with MartyBlocks installed
      • Writing, security, ELA
        • MartyBlocks
        • compatible device
        • workbook

      Learning Objectives

      • I can write instructions for a person to enter a code.
      • I can write a program to unlock an action.

      Pre-lesson preparation

      Any device that requires a combination would be a useful prop: bicycle lock, mini-safe, bank card, key lock. Display these at the front and ask learners to think about what they have in common, as they enter the room. If you do not have these available, slide 4 illustrates a variety to talk about.

      Warm-up

      Share with learners the learning objectives and success criteria for the lesson (slide two from the presentation). Ask learners if they have anything with a password that they like to keep secure. There may be a variety of answers, these may include any devices they use or share, email passwords, any child bank accounts, diaries, etc.

      Have learners talk in their groups about the usefulness of passwords. What purpose do they serve, they secure things, they keep things private, etc. Ask learners to record ideas in their workbook.

      Showcase Marty from slide three demonstrating a password being entered incorrectly and then correctly. The password is three letters with corresponding notes.

      Get learning

      Show learners some examples from slide four that feature uses for locks and passwords, the notes will guide what to say for each example. The goal is to share the range of examples that rely on good security. Take time to show the various levels of security that can be used for passwords and how secure each example is. In the notes, for slide five, is a link to a website that will let learners see how quickly a computer can crack a password. The images on this slide show five examples of the level of security for different passwords. Feel free to access it here to show your class. https://www.passwordmonster.com/

      Slide six showcases a video of a standard combination lock and the mechanics of what opens it just for information; this can be removed, if time is limited.

      For this lesson, learners will be using Marty as the safe or the lock and other groups will try to crack the code. Slides seven to nine will walk learners through the steps needed to create the code to ‘unlock’ an action. We use the sound functionality that Marty has, accessed in the sound section to indicate if the letter that was chosen and if password is correct: you will see that Marty can play an octave for a chosen instrument. Some instruments have a lower note, so they allow for a lower octave.

      Learners will need to craft instructions for others in the class to try and get Marty to reveal a special tune, a new move, or a recording if you have already explored that functionality with Marty. Have learners think within group about a way to ask others to enter a password: what is being secured, how can we enter the password, how many letters can I choose from? It is important that the instructions are clear otherwise no one will be able to guess the correct answer. Before showing slide ten, have learners develop their password plan. Slides ten to twelve will show Marty responding to a basic code program and then how the code was built.

      Time for Practice

      Learners need to decide on a length for their password, and a way for checking if the correct note was played to access what is being secured. In the example, at the start of the presentation and described in the teacher guide, Marty’s password has three letters that make up the password. The three letters correspond to three notes. In the example, there are six eventualities that could be created from the code. If the note letters could be reused, there would be twenty-seven combinations. The more note letters you allow for the password, the more potential passwords there are.

      On slide 10, the broadcast and receive blocks are shown. These are crucial for creating tidy, readable code when there are if blocks. The broadcast block is in the events section. Slide 11 gives an example of these blocks in use when different notes are guessed. The broadcast blocks are especially useful when you have more than 1 note, and more than 2 choices, for the password: it gets really messy to have so much code blocks inside the if statements. The presentation illustrates how to build a one note password device. Learners will use this to extend the password to something more secure but still guessable in the lesson time.

      In the example code, from the teachers guide, we used a low instrument as an incorrect guess and a higher instrument as a correct guess; however, if the first guess is incorrect, all following guesses are also marked as incorrect because the whole combination will be wrong.

      Cooldown

      Bring learners back together to discuss the learning. Ask them if there any passwords they have that they might consider changing because they are not very secure.

      Suggested questions you might ask:

      • Did clear instructions important for the people guessing your password? Did you think at all about the difference it would have made if your password had not been clear?
      • Was a three-letter password very secure?
      • Did you discover any ways to make it more secure?
      • Did you find the broadcast block useful? Can you think of any other uses it might serve?

      Carry out any end of lesson routines.

      Extensions & Support

      Extension

      Have learners plan code that either allows note letters to repeat or allows for a fourth note letter for the password. Have them explore how much more complicated the code will become if that were to happen.

      Support

      Support writers with a skeleton framework for instructions they might use for the instruction text, included in the learner resources.

      Have learners initially create the code for one note letter for the password, highlighting the use of the broadcast and receive blocks. Then challenge them to add one more note letter to the password with an if then else block. Explicitly state that the ‘then’ part is what the person chose, and the else part is the other letters.

      • Middle School Technology Applications: Grade 6 to Grade 8
      • Elementary Technology Applications: Grade 3 to Grade 5
      • Elementary Grade 4: English Language Arts and Reading
      • Technologies: Computing Science
      • Literacy & English: Writing
      • English Language Arts: Writing
      • CSTA Education Standards
      • England's National Curriculum - English: Writing - Composition
      • Digital Technologies, Design & technologies: Digital Technologies
      • Australian Curriculum - English: Literature - Reading & Writing
      • Computing, Design and Technology: Computing

      Learner Resources —