Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1if (!email.includes("@")) { showError(); } | Aif (history.length > 0) { history.pop(); } | |
| 2confirm("Delete this file?") | BThe error message is vague and the check is incomplete. Users need a clear message such as 'Enter an age between 0 and 120' to fix the problem and recover. | |
| 3Undo lets users recover from a mistake by reversing the last action they took. | CA confirmation prompt: it makes the user pause and check before an action that is hard to reverse. | |
| 4Preventing mistakes: a form accepts only an age in a sensible range, so typing errors are caught early. | DThere is no confirmation prompt, so one accidental click permanently deletes the account with no chance to notice or recover. Add a confirm step first. | |
| 5deleteAccount(); // runs straight away, no prompt | Eif (age < 0 || age > 120) { showError(); } | |
| 6if (age < 0) { showError("Error 42"); } | FInput validation: the system checks what the user typed and flags a problem before the mistake is saved. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
error tolerance — A useability principle: the interface prevents mistakes where it can, and helps users notice and recover from the ones they make, using validation, confirmation prompts and undo.age = entry.get()
if age.isdigit():
save(age)ok = messagebox.askyesno("Delete", "Sure?")
if ok:
delete_file()history.append(text)
def undo():
return history.pop()if score < 0 or score > 100:
show_error("Enter 0 to 100")
try:
n = int(entry.get())
except ValueError: