← QCE Digital Solutions Unit 1

Useability principle: safety

A useability principle: the interface prevents harmful mistakes, such as with confirmation, clear warnings and data protection, and lets users recover from errors, such as with undo.

Understanding Useability principle: safety in QCE Digital Solutions Unit 1

What it does: The message box states the consequence clearly and gives the user a choice to stop. That is a clear warning supporting safety. The show="*" option masks what the user types, keeping a password private. This protects personal data, a safety sub-theme. Undo lets users reverse an error. Safety is about both preventing mistakes and helping users recover from them. Clear warnings use plain language and tell users what will happen and what they can do. Cryptic codes do not help users avoid harm. Placing a risky action away from common ones, plus confirming it, reduces accidental harmful clicks. A safe interface asks the user to confirm first, such as with a confirm() dialog, before running a destructive action.

Common mistakes: The confirmation dialog was replaced with True, so the file is deleted without asking. It should be ok = askyesno('Delete file?') so the user can cancel a harmful action. Undo must restore the deleted item, not remove it again. The line should be items.append(item) so the user can recover from the mistake.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 60–81) and word search (Modules 1–81).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A user clicks Delete on a file. Which design is safer?
The file disappears instantly with no messageA pop-up asks 'Delete this file? This cannot be undone.' with Cancel and Delete buttons
Matches
deleteButton.onclick = deleteAccount;
↓
The account is deleted immediately with no confirmation, so one accidental click causes permanent harm.
Applying
Meanings
Term
safety
Meaning
A useability principle: the interface prevents harmful mistakes, such as with confirmation, clear warnings and data protection, and lets users recover from errors, such as with undo.
Practice
IF user clicks Delete THEN
Testing
Gaps
if messagebox.("Delete?", "Sure?"):
Check Answer
Spots
1ok = True
2if ok:

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Firefly' badge — Night Coder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A user clicks Delete on a file. Which design is safer?
A. A pop-up asks 'Delete this file? This cannot be undone.' with Cancel and Delete buttons ✓
B. The file disappears instantly with no message
A confirmation step gives users a chance to stop a harmful mistake before it happens. This supports the safety principle.
2. Which feature helps a user RECOVER after making a mistake?
A. A bright colour on the Save button
B. An Undo button that restores the deleted text ✓
Undo lets users reverse an error. Safety is about both preventing mistakes and helping users recover from them.
3. True or false: A safe interface only needs to stop mistakes, and recovery does not matter.
A. True: prevention is the only part of safety
B. False: it should also help users recover from errors ✓
Safety covers prevention (confirmations, warnings) and recovery (undo, restore). Both parts matter.
4. A sign-up form collects a student's home address and phone number. Which is the safer choice?
A. Hide the details from other users and explain who can see them ✓
B. Show all details publicly by default so users can find each other
Protecting personal data is part of safety. Private details should not be exposed by accident.
5. Which warning is clearer and safer?
A. Warning: Closing now will lose your unsaved work. Save first? ✓
B. Error 0x4F: operation terminated
Clear warnings use plain language and tell users what will happen and what they can do. Cryptic codes do not help users avoid harm.

Match the Pairs

if (confirm("Delete this file?")) { deleteFile(); } → Asks the user to confirm before a destructive action runs, preventing an accidental delete
undoStack.pop() → Removes the last saved action so the user can reverse a mistake and recover from it
A clear warning tells users what will be lost before they continue, so they can avoid a harmful mistake → messagebox.askyesno("Warning", "This will erase all your work. Continue?")
Protecting personal data means hiding sensitive input so others cannot see it → password_entry = Entry(window, show="*")
deleteButton.onclick = deleteAccount; → The account is deleted immediately with no confirmation, so one accidental click causes permanent harm.
showMessage("Error 0x4F") → The message is unclear, so the user cannot tell what went wrong or how to recover from the error.

Key Term

safety
A useability principle: the interface prevents harmful mistakes, such as with confirmation, clear warnings and data protection, and lets users recover from errors, such as with undo.

Fill in the Blanks

1. if messagebox.askyesno("Delete?", "Sure?"): delete_file()
Hint: Type the messagebox function that asks a yes/no confirmation question before deleting.
2. history.append(text) text = history.pop()
Hint: Type the list method that removes and returns the last saved item, so the user can undo.
3. pw = Entry(win, show="*")
Hint: Type the Entry option name that hides typed characters to protect personal data.
4. messagebox.showwarning("Warning", "Sure?")
Hint: Type the messagebox function that displays a clear warning dialog.
5. ok = messagebox.askyesno("Delete", "Sure?") if ok: delete_file()
Hint: Type the variable that stores the user's confirmation choice.

Spot the Error

Question 1
A ok = True
B if ok:
C remove(name)
Line A — The confirmation dialog was replaced with True, so the file is deleted without asking. It should be ok = askyesno('Delete file?') so the user can cancel a harmful action.
Question 2
A def undo():
B item = undo_stack.pop()
C items.remove(item)
D print('Restored', item)
Line C — Undo must restore the deleted item, not remove it again. The line should be items.append(item) so the user can recover from the mistake.
Question 3
A pw = Entry(root)
B pw.pack()
C b = Button(root, text='Go')
Line A — Without show='*' the password is displayed in plain text, so anyone nearby can read it. The Entry should use show='*' to protect personal data.
Question 4
A def check_pw(pw):
B if len(pw) < 8:
C msg = 'Use 8+ chars'
D warn.config(text='!')
Line D — The warning shows only '!', which does not tell the user what is wrong. It should display the clear message with text=msg.
Question 5
A user = entry_user.get()
B pw_hash = entry_pw.get()
C save(user, pw_hash)
Line B — This stores the password as plain text. To protect personal data it should be hashed: pw_hash = hash(entry_pw.get()).

Student with a class code? Join your class →