English · Dansk · Bahasa Malaysia
Step 3: result and restart
When the test ends, the window shows your words per minute, your accuracy and the number of right and wrong characters. A Restart button resets the time, the input and the colours, and shows a text, during a test or after it. A word is five characters, spaces included, so 300 right characters in 60 seconds give 60 words per minute.


Run it
What step 3 taught
- The five-character word. Words per minute is the right characters divided by five, divided by the minutes used. Counting characters avoids arguing about what a word is.
- Pure functions are easy to test.
calculate_wpm and calculate_accuracy take numbers and return numbers, so a table of known values tests them, including the empty case.
- Resetting state. Restart starts a new
TypingTest instead of clearing fields one by one, so nothing from the earlier test can remain. The window cancels its timer callback before it starts a new one.
Files of this step: scoring.py, typing_result.py, typing_test.py, typing_view_model.py, typing_view.py.
Home · Setup