Level 6

Public or Private?

Level 6 · Chapter 12

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Impacts of Computing · Grades 6–8

Decide what to share and what to keep private.

Code 2-IC-23Read the official text

Common Core State Standards for Mathematics

Ratios & Proportional Relationships · Grade 6

Compare two amounts with a ratio.

Code 6.RP.A.3Read the official text

The short lines are our own words. We matched this lesson to these standards ourselves; the standards' owners have not reviewed or endorsed this course.

Common Core State Standards © 2010 National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Today you will sort the data your launched game saves with one list loop, then build a score board that shows only public data.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-IC-23 · ISTE 1.2.d · Standards
🎯 I cansort the data your launched game saves with one list loop, then build a score board that shows only public data
📝 New words6 words
⏱ Lesson time~45 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students copy the same ask and check under every card. Chapter 7 taught why copies are a defect — hold the cards in a list and run one loop instead.
  • Students forget to move the loop counter, so the same card is asked five times. The counter must change inside the loop, after the check.
  • Students think one answer fits every person. Some data is private for one person and fine for another — a good design lets each player decide.
  • Students put the score on the board without asking whether the player marked it public. The board must test the public list with contains before it adds the line.

🎯 Differentiation

🐢 Struggling: Give the student the two lists already filled with three cards. They only build the loop, the ask, and the if/else. Skip the score board part.

🚀 Advanced: Ask the student to let each player mark one extra card as private for them, keep that choice in a third list, and check it inside the same loop.

💡 During the lesson

  • Warm-UpEvery student works on the game they launched in Chapter 10 — the high score it already saves is the first card. Name social engineering for older students: people who attack accounts collect small public facts — a school, a pet name, a date — and put them together to guess a password. That is why the same fact can be safe to show and risky to show at once.
  • Try ItThe three experiments are the three parts of the final check. The first shows why two lists in the same order need no copied code. The second, with a step of 0, reads card 1 three times — the counter bug from the misconceptions. The third shows that the board reads the student's own sort: only a public high score reaches public_board.
  • PlanThe two matching lists are the key artifact. A student who can draw card 1 next to answer 1 writes one loop; a student who cannot will copy the same ask and check under every card — the duplication defect Chapter 7 warned about. Require the paper lists before Scratch. Do the first box together: pick, then watch both pictures.
  • BuildStep 10 is the judgment the whole chapter builds toward. contains asks one yes-or-no question of a whole list — is this field in the set I marked public? — so the board reads the student's own sort instead of a hard-coded rule. Chapter 9 of Level 4 taught this block for a name search; here it decides what a shipped game shows the world. Note also that only correctly sorted public cards enter the list: a password typed as public lands in review, so a wrong answer can never widen what the board may post.
    Steps 4 to 7 build one loop in three passes on purpose. The finished check has no copied code: adding a card is two add blocks, and the check never changes. That is the duplication lesson of Chapter 7 applied to the last build of the course — if a student pastes a second ask and if/else, send them back to step 7.