ranelpadon / ngram-type

Touch typing trainer using N-grams as data source, with options to customize the auto-generated lessons and specify the minimum typing performance needed. There are sound/color effects as well.
208 stars 40 forks source link

Time counter starts too soon for WPM calculation #21

Closed kstreser closed 1 year ago

kstreser commented 1 year ago

Hi ranelpadon,

I really like this practice tool and use it regularly. Thank you very much for this!

It seems to me that sometimes the WPM is calculated over a too long period of time resulting in a very low WPM. I noticed that this especially happens if I wasn't typing anything but just waiting some seconds or minutes. I think it should wait until I start typing and count from the first downstroke of a key, right? Most of the times this works but in some occasions not.

Edit: Oh, I think I accidentally hit space after every sequence as a habit thus starting the counter for the new sequence. Seems not to be a problem with the code. Could you make it start counting from a visible character? :)

ranelpadon commented 1 year ago

@kstreser Thanks for your feedback. And this is a good observation/suggestion!

Oh, I think I accidentally hit space after every sequence as a habit thus starting the counter for the new sequence. Seems not to be a problem with the code. Could you make it start counting from a visible character? :)

I implemented it now as per this commit, and I've verified it in the Ngram Type site now: https://github.com/ranelpadon/ngram-type/commit/3324df63a06b060bb60414a25c361d1db9fea0ef

Hence, typing one or more spaces at the start should not trigger the timer anymore. Only the non-space characters will trigger the timer. Please verify so that we can close this issue. Cheers :)

Likewise, this could be the same root cause/fix of this issue: https://github.com/ranelpadon/ngram-type/issues/19

kstreser commented 1 year ago

Works like a charm. Thank you! :+1: