Teacher material · Page · Unpublished in Canvas

Facilitator Guide: Text-Code Bridge Day 1 — Trace, Predict + Repair

Canvas state
Unpublished

TEACHER ONLY · TEXT-CODE BRIDGE DAY 1

Lesson 3: Text Code — Trace, Predict + Repair

One class period · keep the student page as the independent and absence route.

Daily Learning Contract

Topic: Tracing and repairing a text-based nested-loop program

Objective: Students will trace supplied text code, predict its complete output, diagnose one nested-loop boundary error, and modify and implement the code to produce an improved program.

Demonstration of learning: Passport 5 trace/repair record, prediction before Run, unexpected-result screenshot, corrected JavaScript, repaired-result screenshot, and row/column explanation.

Essential TEKS:

  • §126.19(c)(2)(C) — modify and implement previously written code to develop improved programs.

Supporting TEKS:

  • §126.19(c)(2)(A) — construct named variables with multiple data types and perform operations on their values;
  • §126.19(c)(2)(B) — use a software design process to create text-based programs with nested loops that address different subproblems within a real-world context; and

Meets threshold: Meets when the prediction is recorded before Run, the student identifies the mismatched counter/boundary, changes only that condition, reproduces the corrected total, and explains both loop subproblems.

Evidence status: Demonstrated: (2)(C). Practiced: (2)(A) and (2)(B); identifying supplied variables and loops is not independent construction or creation.

Before class

Prerequisite: Completed block-code Game Remix planning/test evidence; can locate the JavaScript view and distinguish a variable from a loop.

Editable teacher deck, slides 23–37 · PowerPoint fallback

MakeCode Arcade · Day 1 highlighted bug route · Teacher exemplar — alternate finished solution; do not use as the starter

Reveal only after student diagnosis/work: Teacher-only code reference · Teacher-only result reference

Student route: Lesson 3: Text Code — Trace, Predict + Repair

Timed lesson flow

  1. 4 min · Launch: Show only the mission and intended 3 × 4 requirement. Ask what evidence would prove the program is wrong. Do not display the corrected line or result.
  2. 6 min · Model: Trace a neutral two-row mini-loop unrelated to the challenge. Model per-row count versus full-program total.
  3. 7 min · Guided practice: Trace row 0 together in Passport 5; identify supplied types and operations without changing code.
  4. 3 min · CFU: Ask: How many placements in one inner-loop pass? How many across all outer-loop passes? Expected: 4 and 12.
  5. 20 min · Independent work: Students paste, predict, run, capture the unexpected result, diagnose, change one boundary, rerun, and explain.
  6. 5 min · Submit: Check all five 5-point elements before accepting the submission.
  7. 5 min · Close: Ask one student to connect the exact condition change to the new total. Reveal teacher references only now.

Expected answers

  • missionName is string; rows/columns/suppliesPlaced are numbers; priorityMode is Boolean.
  • One inner-loop pass places 4 supplies; all three outer iterations place 12.
  • The bug uses column < rows, producing 3 columns per row and 9 total.
  • The repair uses column < columns, producing 4 columns per row and 12 total.
  • Outer loop = row subproblem; inner loop = complete the columns within each row.

Likely misconceptions

  • Answering 4 when asked for the full program total.
  • Changing rows or columns instead of the mismatched boundary.
  • Claiming supplied variable declarations as independently authored (2)(A) evidence.
  • Backfilling the prediction after seeing the result.

Scaffolds, recovery, and absence

Scaffolds: Read the code aloud by line number; cover the simulator until the prediction is recorded; after the first attempt, point to the two loop headers without naming the replacement. Allow oral explanation recorded by the teacher, but retain the same code and test evidence.

Recovery: Create a new project, select JavaScript, and paste the Bug Challenge text again. Check brackets and the two loop headers before replacing any additional code.

Absence route: Use the student page, Bug Challenge file, Passport 5, and the same five-part scoring checklist. The student submits both results and the explanation; no live partner is required.