-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "practice missed words" mode (#89)
* Add "practice missed words" mode \## Motivation Monkeytype has the possibility of training just the words that you miss and this seems like a straight forward thing to add. \## Implementation Main change is to add a mssed_words item to the Result struct ```rust pub struct Results { pub timing: TimingData, pub accuracy: AccuracyData, pub missed_words: Vec<String>, } ``` And on the Results State, listen for 'p' (practice) to start a new test from missed words. ```rust state = State::Test(Test::from_missed_words(&result.missed_words)); ``` For the `Results` struct I did a very small refactor in the `From<&Test>` Trait implementation. I moved the calculation of each result to its own function, to leave the From function easier to follow. ```rust Self { timing: Self::calc_timing(&events), accuracy: Self::calc_accuracy(&events), missed_words: Self::calc_missed_words(&test), } ``` * Address PR comments
- Loading branch information
Showing
3 changed files
with
103 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters