Skip to content

Commit

Permalink
Calculate accuracy based on non-padded text (#165)
Browse files Browse the repository at this point in the history
The accuracty should be calculated based on the length of the initial
text (self.text_backup) instead of the possibly padded text (self.text).
  • Loading branch information
samgiz authored Jun 4, 2024
1 parent 273f148 commit 7249e66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mitype/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_end(self, win):
# Calculate stats at the end of the test
if self.mode == 0:
self.current_speed_wpm = speed_in_wpm(self.tokens, self.start_time)
total_chars_in_text = len(self.text)
total_chars_in_text = len(self.text_backup)
wrongly_typed_chars = self.total_chars_typed - total_chars_in_text
self.accuracy = accuracy(self.total_chars_typed, wrongly_typed_chars)
self.time_taken = get_elapsed_minutes_since_first_keypress(self.start_time)
Expand Down

0 comments on commit 7249e66

Please sign in to comment.