Hi @bilalmlkdev ! I'm Siddhesh, and I'm currently contributing to RhythmKey as part of my ROSPL open-source project.
While testing the typing engine locally, I came across this accuracy calculation issue and was able to reproduce it consistently.
What happened?
Accuracy can become negative when incorrect characters are repeatedly typed and then deleted with Backspace.
The Accuracy formula is documented as:
((Total Characters - Mistakes) / Total Characters) * 100
When a wrong character is typed, the mistake counter increases. Pressing Backspace removes the character from the current input, but the mistake count is not reduced. Repeating this process can therefore make the number of mistakes greater than the number of characters currently in the input.
For example, I was able to reproduce an Accuracy of approximately -780%.
This also appears to affect the accuracy values used in the performance graph/statistics.
Steps to reproduce
- Go to
/app/taketypingtest.
- Start a typing test.
- Type an incorrect character.
- Press Backspace to remove it.
- Repeat the incorrect character → Backspace sequence multiple times during the same test.
- Finish the test.
- Open the results screen and check the Accuracy value.
- Observe that Accuracy can become negative.
What did you expect to happen?
Accuracy should remain within a valid percentage range (0-100) and should not become negative.
Incorrect attempts and corrected characters should also be handled consistently when calculating the final Accuracy.
Browser
Google Chrome 153
Theme
None
Screenshots or additional context
Additional context:
The issue was reproduced locally using the development build.
The documented Accuracy formula is:
((Total Characters - Mistakes) / Total Characters) * 100
The current implementation uses the current userInput.length as Total Characters. A wrong printable key increments mistakes, while Backspace removes the character from userInput without decrementing mistakes.
As a result, repeated corrections can cause mistakes to exceed the current number of characters, producing negative Accuracy values.
Examples observed during testing:
- Accuracy: -66%
- Accuracy: -4300%
No files were modified while investigating this issue.
Hi @bilalmlkdev ! I'm Siddhesh, and I'm currently contributing to RhythmKey as part of my ROSPL open-source project.
While testing the typing engine locally, I came across this accuracy calculation issue and was able to reproduce it consistently.
What happened?
Accuracy can become negative when incorrect characters are repeatedly typed and then deleted with Backspace.
The Accuracy formula is documented as:
((Total Characters - Mistakes) / Total Characters) * 100
When a wrong character is typed, the mistake counter increases. Pressing Backspace removes the character from the current input, but the mistake count is not reduced. Repeating this process can therefore make the number of mistakes greater than the number of characters currently in the input.
For example, I was able to reproduce an Accuracy of approximately -780%.
This also appears to affect the accuracy values used in the performance graph/statistics.
Steps to reproduce
/app/taketypingtest.What did you expect to happen?
Accuracy should remain within a valid percentage range (0-100) and should not become negative.
Incorrect attempts and corrected characters should also be handled consistently when calculating the final Accuracy.
Browser
Google Chrome 153
Theme
None
Screenshots or additional context
Additional context:
The issue was reproduced locally using the development build.
The documented Accuracy formula is:
((Total Characters - Mistakes) / Total Characters) * 100
The current implementation uses the current
userInput.lengthas Total Characters. A wrong printable key incrementsmistakes, while Backspace removes the character fromuserInputwithout decrementingmistakes.As a result, repeated corrections can cause
mistakesto exceed the current number of characters, producing negative Accuracy values.Examples observed during testing:
No files were modified while investigating this issue.