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

WPM is inaccurate sometimes #19

Closed awelotta closed 1 year ago

awelotta commented 2 years ago

Sometimes the WPM is inaccurate. Reloading the website doesn't help. https://youtu.be/JP0CoyJm2F8 In this video I'm type 1535 letters in about 30 seconds (from 0:02 to 0:33), so my WPM should be 150, but it's reading as 173. If it's raw WPM, then at 97% accuracy, my raw WPM should be maybe 154ish.

I use Brave browser on Microsoft. This has been happening here for since maybe two weeks. Sometimes the WPM seems accurate, especially when I first open it that day; but then when I open it again or leave the tab and come back, the WPM is way too high.

ranelpadon commented 1 year ago

@awelotta Sorry for the late reply, kinda busy with various stuff last time. Checked the video, and the 173 WPM is too much indeed.

The are 45 Tetragrams in that example which is 1 Tetragram = 4 letters, so if we add the spaces, we'll have 45 * 5 letters = 45 words (i.e. 5 letters = 1 word). So, to approximate it, if you typed them in 1 minute/60 seconds with 100% accuracy, you'll have 45 WPM, but since you typed it for 30 seconds, it would be 90 WPM. Not sure how did you get the 1535 letters and 150 WPM.

Likewise, I noticed that the page timer at the upper left is still counting at the start of the video, so it means you're continuing some typing activity/unfinished lesson? I think one possibility is you switched the Scope while in the middle of another lesson in another Scope. So, your previously typed letters get counted again in the new Scope since it didn't end naturally (i.e. the previous lesson was not fully typed before switching to another Scope, so it didn't reach the pass/fail hook in every lesson).

In any case, I realized also that changing Scope should reset the current metrics to avoid affecting the new Scope in the computation. I improved the logic now as per this commit. Changing Scope will now pause the page timer also, and will resume once the user starts typing again. Scope was just added recently, so this is kinda a subtle bug in resetting metrics. Hopefully, will fix also your issue.

BTW, thanks for the heads-up and Happy New Year! :)

awelotta commented 1 year ago

Sorry, I meant 15*3*5. But I also don't know how I got 150 lol.

It still seems inaccurate, but I think that you fixed the original issue. Not sure, because I'm not sure how to reproduce it.

I think it may have something to do with Keyman:

I have two layouts. One of them is Semimak JQ implemented with Keyman, the other is QWERTY that comes with Window. Using Semimak JQ seems to underreport the WPM, and and would be even larger after dividing by the accuracy. I thought that the error might be due to me being slower on Semimak JQ,, so I tried using QWERTY but being deliberately slower, but that had the WPM correct.

Here's a video of me using the Semimak JQ layout

I typed ~15 words in ~8 seconds, so it should be `15/(8/60) = 112.5 wpm", but it reports 99 wpm. I was reloading the page a bunch so I could use the timer.

Clearing site data doesn't seem to fix it. Seems to be the same issue on Firefox as well.

I think if Keyman is the issue, then it the issue might lie with listening to virtual keys vs. characters. But I'm not sure how that would work, because Semimak JQ only shares one character in common with QWERTY, and I have been able to pass tests before with the alt layout.

Sorry if anything is unclear. Does this happen for you? Also, I haven't tried it with Microsoft Keyboard Layout Creator or AHK.

ranelpadon commented 1 year ago

Thanks for your feedback. I think that 99 WPM looks reasonable also since you're just using an approximation of 8 seconds which could also be 7.5, 8.5, 8.25, etc? And these sub-second approximations affect the computations.

What do you mean the original issue is fixed?

It still seems inaccurate, but I think that you fixed the original issue.

Also, have you tried using MonkeyType's short burst tests to check your WPM against your keyboard?

ranelpadon commented 1 year ago

@awelotta Looks like #21 is a related issue to yours? And it's because the user has a habit of typing a space before taking a break which triggers the timer affecting the WPM calculation:

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 fixed the #21 issue now also as per the discussion in that thread.

ranelpadon commented 1 year ago

FYI, closing this since I think it's related to #21 which is already fixed. Feel free to re-open this if you think it's still not resolved. Cheers :)