Error tolerance

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Error tolerance

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A student clicks Delete on a quiz result and the app asks 'Are you sure you want to delete this result?' before removing it. Which design idea is this?
A Error tolerance: a confirmation before delete prevents an accidental mistake
B Poor error tolerance: the extra question just slows the user down
2. A user deletes the wrong file by accident. Which feature best helps them recover?
A A message saying 'Delete complete'
B An Undo button that restores the file
3. A form asks for a state. Which design better limits mistakes in input?
A A blank text box where users type any text
B A drop-down list with QLD, NSW, VIC and the other states
4. Which is the clearer error message for a date typed in the wrong format?
A Please enter the date as DD/MM/YYYY, for example 05/03/2025.
B Error 4021: invalid input.
5. A search box finds 'Brisbane' when the user types 'brisbane' or ' Brisbane ' with a space. What does this show?
A The interface accepts reasonable variations in input
B The interface has no validation at all

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1confirm("Delete this file?") A<select name="year"><option>11</option><option>12</option></select>
2undoStack.pop() BAsks the user to confirm before a destructive action, preventing accidental deletion
3Limiting input choices prevents invalid entries by letting the user pick only from allowed options Cprint("Age must be a number from 12 to 18")
4A clear error message tells the user what went wrong and how to fix it DThe record is deleted straight away with no confirmation, so one accidental click causes permanent data loss.
5if clicked(deleteButton) then deleteRecord() EReverses the most recent action so the user can recover from a mistake
6print("Error 402") FThe error message is vague. It does not explain the problem or how the user can fix it.

Definitions

error tolerance

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
print "Delete this record? yes/no" input choice __ choice = "yes" then
2.
lastDeleted ← record delete record record ← ___________
3.
if age < 0 __ age > 120 then print "Enter an age between 0 and 120" end if
4.
allowed ← ["Red", "Blue", "Green"] input house if house ___ in allowed then
5.
input answer answer ← _________(answer) if answer = "yes" then

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A delete file permanently
B print "File moved. Restore?"
C input reply
D if reply = "Y" then
E restore file
Question 2
A lastAction <- currentText
B input choice
C if choice = "save" then
D currentText <- lastAction
Question 3
A input age
B while age < 0 or age > 120
C print "Age must be 0-120"
D stop program
E end while
Question 4
A choices <- ["Red", "Blue"]
B input pick
C while pick not in choices
D choices <- pick
E end while
Question 5
A input answer
B answer <- uppercase(answer)
C if answer = "yes" then
D delete file

Answer Key

Error tolerance
Section A: Quick Questions
Q1
A — Error tolerance: a confirmation before delete prevents an accidental mistake
Q2
B — An Undo button that restores the file
Q3
B — A drop-down list with QLD, NSW, VIC and the other states
Q4
A — Please enter the date as DD/MM/YYYY, for example 05/03/2025.
Q5
A — The interface accepts reasonable variations in input
Section B: Match the Pairs
Q1
confirm("Delete this file?") → Asks the user to confirm before a destructive action, preventing accidental deletion
Q2
undoStack.pop() → Reverses the most recent action so the user can recover from a mistake
Q3
Limiting input choices prevents invalid entries by letting the user pick only from allowed options → <select name="year"><option>11</option><option>12</option></select>
Q4
A clear error message tells the user what went wrong and how to fix it → print("Age must be a number from 12 to 18")
Q5
if clicked(deleteButton) then deleteRecord() → The record is deleted straight away with no confirmation, so one accidental click causes permanent data loss.
Q6
print("Error 402") → The error message is vague. It does not explain the problem or how the user can fix it.
Section C: Definitions
Q1
error tolerance — An interface design quality where mistakes are prevented, reasonable input variations are accepted, and users can easily recover, such as with undo, confirmations and clear error messages.
Section D: Fill in the Blanks
Q1
print "Delete this record? yes/no" input choice if choice = "yes" then
Q2
lastDeleted ← record delete record record ← lastDeleted
Q3
if age < 0 or age > 120 then print "Enter an age between 0 and 120" end if
Q4
allowed ← ["Red", "Blue", "Green"] input house if house not in allowed then
Q5
input answer answer ← lowercase(answer) if answer = "yes" then
Section E: Spot the Error
Q1
A — Permanent deletion gives the user no way to recover from a mistake. An error-tolerant interface moves the file to a recycle bin first, so it can be restored: move file to recycle bin.
Q2
C — The undo step must run when the user chooses "undo". Checking for "save" means the restore code never runs when undo is requested. It should be if choice = "undo" then.
Q3
D — After showing the error message, the user should be able to recover by trying again. Stopping the program forces them to start over. The line should be input age so they can re-enter a valid value.
Q4
D — The loop should ask the user to choose again until the pick is in the list of allowed choices. Assigning pick to choices overwrites the list of valid options. It should be input pick.
Q5
B — An error-tolerant interface accepts reasonable variations such as Yes, YES and yes. Converting to uppercase means the comparison with "yes" never matches. It should use lowercase(answer).