The worksheetDownload the PDF
Answers

F12.2 Personal data and privacy

Technology and society · GCSE · OCR J277 1.6.1, AQA 8525 3.8, Edexcel 1CP2 5.2.1 · about 15 min

BugBotLab

What this lesson is about

What personal data is, the Data Protection Act 2018, and anonymising a log.

Questions 6 marks in all

  1. [1 mark]Which of these is personal data?

    1. AA student's school email address
    2. BThe number of robots in a room
    3. CThe speed of a motor
    4. DThe colour of a mat
    Answer: A. It identifies a living person.
  2. [1 mark]Which law protects personal data in the UK?

    1. AThe Data Protection Act 2018
    2. BThe Computer Misuse Act 1990
    3. CThe Copyright, Designs and Patents Act 1988
    4. DThe Freedom of Information Act 2000
    Answer: A. It works alongside the UK GDPR, and together they set the rules for anyone holding personal data.
  3. [1 mark]What does data minimisation mean?

    1. ACollect only the data you actually need
    2. BCompress the data
    3. CDelete all the data at once
    4. DStore data on the smallest disk
    Answer: A. The data you never collect cannot leak.
  4. [1 mark]Which is a right people have over their own data?

    1. ATo see what is held about them and have mistakes corrected
    2. BTo see everyone else's data
    3. CTo be paid for it
    4. DTo stop the company trading
    Answer: A. Access and rectification are two of the rights in the Act.
  5. [1 mark]A school keeps robot logs with names for ten years. Which principle does this break?

    1. AKept no longer than needed
    2. BAccuracy
    3. CLawfulness
    4. DSecurity
    Answer: A. Data must be deleted once the reason for holding it has gone.
  6. [1 mark]What does this program print?

    rows = [('Sam', 240), ('Ava', 180)]
    for n, (name, cm) in enumerate(rows, start=1):
        print(f'student {n}: {cm} cm')
    Answer:
    student 1: 240 cm
    student 2: 180 cm

    The names are replaced by numbers.

The task: anonymise the log

Each row of log is a name, an email and a distance in centimetres. Print an anonymised line for each, in the form student 1: 240 cm, numbering the students from 1 in the order they appear. Then print records: <n> and total: <n> cm. Nothing in the output may contain a name or an email.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

# name, email, distance in cm
log = [
    ("Sam Patel", "sam@school.uk", 240),
    ("Ava Ng", "ava@school.uk", 180),
    ("Jo Reilly", "jo@school.uk", 95),
    ("Kit Hale", "kit@school.uk", 310),
]

The hint students can ask for: Number the students as you walk the list, printing only the number and the distance. Keep a running total of the distances, and the number of records is the length of the list.

A solution

from bugbot import *
connect()
log = [
    ("Sam Patel", "sam@school.uk", 240),
    ("Ava Ng", "ava@school.uk", 180),
    ("Jo Reilly", "jo@school.uk", 95),
    ("Kit Hale", "kit@school.uk", 310),
]
total = 0
for n, (name, email, cm) in enumerate(log, start=1):
    print(f"student {n}: {cm} cm")
    total = total + cm
print("records:", len(log))
print("total:", total, "cm")

Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.