hcp-uw / syntext

website for practicing your typing
5 stars 0 forks source link

Performance Tracking #29

Closed elimelt closed 1 year ago

elimelt commented 1 year ago

We need to finish implementing the typing data collection feature to track how quickly and accurately the user is typing.

So far, we've tried using an array of arrays, where each sub array corresponds to a second that the user was typing, and which contains all of the characters they typed.

The issue with this approach has been keeping track of whether or not what they typed is both correct and the first time they typed it.

elimelt commented 1 year ago

To track the number of mistakes, just count the number of times they pushed backspace.

elimelt commented 1 year ago

Progress update

In my current implementation, I use a string that corresponds to the raw text the user should type, including newline characters (\n), tab characters (\t), and spaces. This string is then compared character by character with the user's input to record any valid input in a "snapshot" string of the user's progress. The snapshot string is only updated the first time the user types a given substring.

The amount that the length of this snapshot changes each second is recorded, representing the "characters typed per second" metric for each second the user types. This data is then processed by taking the average of each point with its surrounding elements to smooth out the data. The reason for this is that if the user stops typing for a second, their instantaneous WPM would drop to zero without this smoothing effect.

To Do:

elimelt commented 1 year ago

Update:

progress tracking now functional and integrated with GameSummary.