Test Cooldown Demo
A minimal one-step demo of the test cooldown feature: clicking 'Test My Work' locks the button for a few seconds with a live countdown, while an 'I'm sure' button runs the same tests silently — passes still unlock Next, but no result panel appears.
The Test Cooldown
Why this matters
Real homework benefits from thinking between test runs. A short
cooldown nudges students to read failure messages instead of mashing
the test button. The I’m sure override is there for the rare case
a student is confident the code works and is willing to skip the
visual feedback to advance.
🎯 You will learn to
- Apply the cooldown gate by running the visible test and observing the timer countdown
- Evaluate the
I’m suresilent path: when does it advance the tutorial without showing test results?
What to try
- Click Test My Work. The starter code returns
None, so the test fails. The button is replaced by⏱ Test My Work (0:03)andI’m sure. - While the timer runs, click
I’m sure. The test panel is not updated — silent runs hide their results. The Next button stays locked because the test still fails. - Fix
answer()inmain.pyto return42. ClickI’m sureagain. The test panel still doesn’t change, but Next unlocks (the silent pass is the gate, the panel is just feedback). - Wait for the countdown to reach zero. The
⏱button is replaced by the normal✓ Test My Workagain, and theI’m surebutton disappears. - Refresh the page mid-cooldown. The countdown picks up from where
it was — the end timestamp lives in
localStorage, so reloading can’t bypass it.
def answer():
# TODO: replace `None` with the right number.
return None
What You Just Saw
Why this matters
A short cooldown does for testing what a thoughtful pause does for
replying: it gives the failure feedback time to sink in. The
I’m sure override keeps the gate from being annoying when you
really do know better.
🎯 You will learn to
- Recall the difference between the visible run and the silent override
- Evaluate when a cooldown helps vs hinders learning
Recap
- The visible run gives feedback and starts the cooldown.
- The silent run hides the result panel; if it passes, Next unlocks anyway.
- The end timestamp lives in
localStorage, so refreshing can’t bypass the wait — but the entry is auto-cleaned once the timer expires.