Create a statistics component that displays raw and net WPM on completion of a typing test.
Bug Fixes / Minor Changes
Fix bug where next letter was not set correctly if user typed an error
Why
Reporting WPM is part of core functionality for a typing test.
How
State variables were added to track total number of characters typed as well as start/end time. These are passed as parameters along with the array of objects of expected word vs. typed word to the statistics component, which performs all the comparisons to determine what letters typed were correct, missed, or extra. WPM is calculated based on these values as well as the duration.
Notes
The calculations are based off a standard approach for determining WPM, but there is probably some interpretation on how it should be approached. But for what's included in this PR, it should be sufficient.
Changes
Major Changes
Create a statistics component that displays raw and net WPM on completion of a typing test.
Bug Fixes / Minor Changes
Why
Reporting WPM is part of core functionality for a typing test.
How
State variables were added to track total number of characters typed as well as start/end time. These are passed as parameters along with the array of objects of expected word vs. typed word to the statistics component, which performs all the comparisons to determine what letters typed were correct, missed, or extra. WPM is calculated based on these values as well as the duration.
Notes
The calculations are based off a standard approach for determining WPM, but there is probably some interpretation on how it should be approached. But for what's included in this PR, it should be sufficient.