GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.51

Computational thinking and programming

Diagnose and extend a message protocol

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

Topic 1.51 · Diagnose and extend a message protocol11 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Diagnose and extend a message protocol

Diagnose a message protocol by checking sender, payload type, agreed values, group and receiver branches. Repair the mismatch rather than changing unrelated parts. Retest each affected command.

Today’s two goals
  • Find sender/receiver code mismatches, add new input events and design a complete message table.
  • Explain my method and support it with a labelled trace, example or test record.
Original PaxaKids illustration for Diagnose and extend a message protocol. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Work through an example

If the sender uses numeric code 4 for Stop but the receiver expects 5, the contract disagrees. Agree one code and update the relevant side, then test both Stop and another command.

Try before your workbook

Why is changing the radio group not enough to fix disagreeing Stop codes?

Explore the clues

Tap one card to find out more.

Understand the idea

Diagnose a message protocol by checking sender, payload type, agreed values, group and receiver branches. Repair the mismatch rather than changing unrelated parts. Retest each affected command.

Concept to practise: Diagnose and extend a message protocol.

Work through an example

If the sender uses numeric code 4 for Stop but the receiver expects 5, the contract disagrees. Agree one code and update the relevant side, then test both Stop and another command.

Try before your workbook

Why is changing the radio group not enough to fix disagreeing Stop codes?

Check my readiness thinking

A shared group does not change the meaning of payload values. Both sides must also agree on the message contract and handler behaviour.

Your original programs and learning models

These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.

Diagnose a shared message-code disagreement

A working radio link is not enough if programs disagree about message meanings. Our original agreed protocol is Button A -> number 3 -> Heart, and Button B -> number 4 -> Happy.

The next page deliberately breaks the sender’s codes while keeping the receiver unchanged. Trace what the code requests, then compare it with the intended protocol. Keep the faulty version as evidence.

Read the complete deliberately mismatched pair

Both programs use group 17. The sender requests 4 on A and 5 on B, but the receiver recognises 3 and 4. The receiver has no else branch and no local button handlers. Assume a number arrives when predicting its event behaviour.
Faulty sender: keep this version
radio.setGroup(17)
input.onButtonPressed(Button.A,
    function () {
        radio.sendNumber(4)
    })
input.onButtonPressed(Button.B,
    function () {
        radio.sendNumber(5)
    })
Unchanged icon receiver
radio.setGroup(17)
radio.onReceivedNumber(
    function (receivedNumber) {
        if (receivedNumber == 3) {
            basic.showIcon(
                IconNames.Heart)
        } else if (receivedNumber == 4) {
            basic.showIcon(
                IconNames.Happy)
        }
    })

Compare intended and actual behaviour

Use page 2 and assume each stated number is received. No change means no new display call; it does not mean a blank screen. The agreed meanings from page 1 remain the intended behaviour.
Compare intended and actual behaviour — original model
Faulty sender inputIntended iconActual receiver action
A sends 4Heart{'clue': 'Output or No change', 'prompt': 'Faulty A actual output', 'answers': ['Happy']}
B sends 5Happy{'clue': 'Output or No change', 'prompt': 'Faulty B actual output', 'answers': ['No change']}

Correct the sender to match the agreed protocol

Use this complete corrected sender with the page 2 icon receiver. Group 17 remains; only the payload codes needed correction.
Original Paxa corrected sender
radio.setGroup(17)
input.onButtonPressed(Button.A,
    function () {
        radio.sendNumber(3)
    })
input.onButtonPressed(Button.B,
    function () {
        radio.sendNumber(4)
    })

Modify received-number actions to display words

This complete changed receiver shows READY for 3 and DONE for 4. Use the complete corrected sender on page 4. The payload is still a number even though the selected output is text. Unknown numbers make no display instruction.
Original Paxa word-output receiver
radio.setGroup(17)
radio.onReceivedNumber(
    function (receivedNumber) {
        if (receivedNumber == 3) {
            basic.showString("READY")
        } else if (receivedNumber == 4) {
            basic.showString("DONE")
        }
    })

Extend both programs for a shake message

The complete extended sender adds Shake -> 7. The complete extended receiver adds 7 -> HELP while keeping 3 -> READY and 4 -> DONE. An extension must update both the input/payload rule and the receiving condition/action.
Shake-extended sender
radio.setGroup(17)
input.onButtonPressed(Button.A,
    function () {
        radio.sendNumber(3)
    })
input.onButtonPressed(Button.B,
    function () {
        radio.sendNumber(4)
    })
input.onGesture(Gesture.Shake,
    function () {
        radio.sendNumber(7)
    })
Shake-extended receiver
radio.setGroup(17)
radio.onReceivedNumber(
    function (receivedNumber) {
        if (receivedNumber == 3) {
            basic.showString("READY")
        } else if (receivedNumber == 4) {
            basic.showString("DONE")
        } else if (receivedNumber == 7) {
            basic.showString("HELP")
        }
    })

Add left and right tilt to the complete sender

This complete final sender preserves A, B and Shake, then adds TiltLeft -> 8 and TiltRight -> 9. It pairs with the complete receiver on page 8. The gesture reference describes shake and tilt events.
Original Paxa complete motion sender
radio.setGroup(17)
input.onButtonPressed(Button.A,
    function () {
        radio.sendNumber(3)
    })
input.onButtonPressed(Button.B,
    function () {
        radio.sendNumber(4)
    })
input.onGesture(Gesture.Shake,
    function () {
        radio.sendNumber(7)
    })
input.onGesture(Gesture.TiltLeft,
    function () {
        radio.sendNumber(8)
    })
input.onGesture(Gesture.TiltRight,
    function () {
        radio.sendNumber(9)
    })

Complete the matching multi-message receiver

This complete final receiver handles all five agreed numeric codes. It has no else output, so other numbers leave its display unchanged by this event. Text messages need an appropriate string event and are outside this numeric protocol.
Original Paxa complete motion receiver
radio.setGroup(17)
radio.onReceivedNumber(
    function (receivedNumber) {
        if (receivedNumber == 3) {
            basic.showString("READY")
        } else if (receivedNumber == 4) {
            basic.showString("DONE")
        } else if (receivedNumber == 7) {
            basic.showString("HELP")
        } else if (receivedNumber == 8) {
            basic.showString("LEFT")
        } else if (receivedNumber == 9) {
            basic.showString("RIGHT")
        }
    })

Complete the final input–data–output table

Use the final pair on pages 7–8. Assume each number reaches the matching receive event. Complete the output column from the conditions. A real test must record actual observations or Pending separately.
Complete the final input–data–output table — original model
Sender inputNumber sentReceiver word
A3{'clue': 'Word output', 'prompt': 'Final protocol A', 'answers': ['READY']}
B4{'clue': 'Word output', 'prompt': 'Final protocol B', 'answers': ['DONE']}
Shake7{'clue': 'Word output', 'prompt': 'Final protocol Shake', 'answers': ['HELP']}
TiltLeft8{'clue': 'Word output', 'prompt': 'Final protocol TiltLeft', 'answers': ['LEFT']}
TiltRight9{'clue': 'Word output', 'prompt': 'Final protocol TiltRight', 'answers': ['RIGHT']}

Files for this activity

Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Paxa the Fox

Try one step with Paxa!

Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.

Our Unit 1 learning path
  1. Lesson 1.1: Recall algorithms and representations
  2. Lesson 1.2: Purpose and conventions of pseudocode
  3. Lesson 1.3: Input, output and strings
  4. Lesson 1.4: Identifiers and assignment
  5. Lesson 1.5: Arithmetic and translation
  6. Lesson 1.6: Trace and review a sequence
  7. Lesson 1.7: Conditions and two-way flow
  8. Lesson 1.8: IF THEN and indentation
  9. Lesson 1.9: IF THEN ELSE and decision diagrams
  10. Lesson 1.10: Ordered ELSEIF and fallback ELSE
  11. Lesson 1.11: Match flowchart and pseudocode branches
  12. Lesson 1.12: AND, OR and NOT
  13. Lesson 1.13: Grouping, precedence and review
  14. Lesson 1.14: Why software searches
  15. Lesson 1.15: A successful linear search
  16. Lesson 1.16: An unsuccessful search and termination
  17. Lesson 1.17: Practise and communicate the search
  18. Lesson 1.18: Translate conditions into Python
  19. Lesson 1.19: One-branch IF programs
  20. Lesson 1.20: Two-way IF ELSE programs
  21. Lesson 1.21: Ordered ELIF choices
  22. Lesson 1.22: Ranges and independent decisions
  23. Lesson 1.23: Boolean operators in Python
  24. Lesson 1.24: Design and test recommendations
  25. Lesson 1.25: Trace, debug and reflect
  26. Lesson 1.26: Choose data types and recognise Boolean literals
  27. Lesson 1.27: Set and use Boolean flags
  28. Lesson 1.28: Explain and identify constants
  29. Lesson 1.29: Express constants in three algorithm forms
  30. Lesson 1.30: Use a fixed factor in a calculation
  31. Lesson 1.31: Cast to Boolean and validate an empty response
  32. Lesson 1.32: Recall calls and trace return values
  33. Lesson 1.33: Supply parameters and reuse library code
  34. Lesson 1.34: Choose and import libraries responsibly
  35. Lesson 1.35: Round with floor and ceiling
  36. Lesson 1.36: Use pi and investigate another mathematical feature
  37. Lesson 1.37: Generate random choices within bounds
  38. Lesson 1.38: Investigate random real values and review library use
  39. Lesson 1.39: Retrieve test tables and predict selection outcomes
  40. Lesson 1.40: Decompose everyday problems
  41. Lesson 1.41: Decompose programs and organise shared work
  42. Lesson 1.42: Develop through repeated build/test cycles
  43. Lesson 1.43: Predict and verify algorithm outcomes
  44. Lesson 1.44: Choose representative and boundary tests
  45. Lesson 1.45: Build, execute and review a test plan
  46. Lesson 1.46: Recall physical inputs and compare transmission media
  47. Lesson 1.47: Configure a radio group and agree a message scheme
  48. Lesson 1.48: Send and receive numbers and strings
  49. Lesson 1.49: Trace numeric message sequences
  50. Lesson 1.50: Transmit text and use received data in conditions
  51. Lesson 1.51: Diagnose and extend a message protocol
  52. Lesson 1.52: Review communication and evidence of testing
  53. Lesson 1.53: Project 1: Adventure story
  54. Lesson 1.54: Project 2: Fire, Water, Earth
  55. Lesson 1.55: Check your progress 1
For grown-ups: using this lesson

Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.

2. Fill in your workbook

Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.

Diagnose and extend a message protocol11 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

TAKE YOUR PRACTICE OFFLINE

3. Download the student worksheet

All 11 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.

Student worksheet only · PDF · 8.1 MiB · No answer key included

Download worksheet PDF ↓

TRY FIRST, THEN CHECK TOGETHER

Download the student worksheet →

4. Answers & guidance

Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.

Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.

Show answers for all 11 worksheets

Worksheet 1

  1. Question 1: What connects an input, payload and intended output? an agreed message protocol
  2. Question 2: What should you preserve while investigating a mismatch? the original code and honest test evidence

Worksheet 2

  1. Question 3: What number does Button A actually request here? 4
  2. Question 4: What number does Button B actually request here? 5

Worksheet 3

  1. Question 5: Faulty A actual output Happy
  2. Question 6: Faulty B actual output No change
  3. Question 7: What LED output does this sender code add locally? none
  4. Question 8: What does pressing A on the receiver itself trigger in this code? no programmed button action

Worksheet 4

  1. Question 9: Which code now matches the receiver’s first condition? 3
  2. Question 10: Which code now matches the receiver’s second condition? 4

Worksheet 5

  1. Question 11: Which word is requested when the receiver handles 3? READY
  2. Question 12: Which word is requested when the receiver handles 4? DONE
  3. Question 13: Name the parameter compared with 3 and 4. receivedNumber

Worksheet 6

  1. Question 14: Which added number is requested by a shake? 7
  2. Question 15: Which added word should that received number select? HELP

Worksheet 7

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 8

  1. Question 16: Which number selects the LEFT output? 8
  2. Question 17: Which number selects the RIGHT output? 9

Worksheet 9

  1. Question 18: Final protocol A READY
  2. Question 19: Final protocol B DONE
  3. Question 20: Final protocol Shake HELP
  4. Question 21: Final protocol TiltLeft LEFT
  5. Question 22: Final protocol TiltRight RIGHT

Worksheet 10

  1. Question 23: Predict and test the complete faulty page 2 pair against the agreed page 1 meanings. Investigate both sender buttons, the receiver’s own buttons, received parameter and conditions. Record actual supported-environment/device observations or Pending, preserving intended and actual behaviour separately. Correct the sender with page 4, retest both choices, then modify the receiver to words using page 5. Add the page 6 shake message. Keep complete versions, device assignments, protocol table, predictions, actual or labelled model records, corrections and retests. Cite the evidence here. Faulty sender A4/B5 versus receiver3 Heart/4 Happy: ideal received A selects Happy instead of intended Heart; B5 selects no branch and makes no new display call. Sender adds no LED output; receiver has no local button handlers. receivedNumber compared with3/4. Correction A3/B4 matches unchanged receiver and group17; word modification3 READY/4 DONE; shake extension7 HELP must update both programs. Full preserved faulty/corrected/modified code, specified directions/devices, predictions before actual or Pending evidence, no-change versus blank distinguished, meaningful retests and model/radio limits. No invented physical or simulator execution. Grown-up review; personal evidence is required.

Worksheet 11

  1. Question 24: Use or adapt the complete final pair on pages 7–8. Make a table linking each input, numeric payload and intended output, including left/right tilt and shake. Predict every recognised case and one unknown number, then test and record actual results or Pending. If communicating both ways, give each device a complete send-and-receive program and test each direction separately. Keep source files, assignments, table, actual or labelled model evidence, corrections/retests and contribution. Describe actual partner feedback or Pending, what the tests support, one remaining limit and a next step. Complete coherent input->number->output rules; supplied A3 READY/B4 DONE/Shake7 HELP/TiltLeft8 LEFT/TiltRight9 RIGHT acceptable. Both programs explicitly group17, matching numeric event and receivedNumber conditions. All five branches and unknown99 predicted; no-match makes no new display instruction, not an automatic clear. Actual supported environment/device observations or Pending distinct from ideal/model trace. If bidirectional, complete both sender and receiver roles per device, with separate direction tests and no echo loop implied. Saved source, accurate table, honest contribution/partner status and feedback, corrections/retests, finite test limits and specific next step. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Diagnose and extend a message protocol with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.

Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.

Understand your results

Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.

For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.

Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.

Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.