max-niederman / ttyper

Terminal-based typing test.
MIT License
1.05k stars 76 forks source link

Add "Practice missed words" option on results page #88

Closed glazari closed 11 months ago

glazari commented 1 year ago

On Monkeytype there is an option to practice the missed words from a test. I find this very useful for practicing.

Since there is an intention of making this feature compatible with monkeytype (as mentioned here https://github.com/max-niederman/ttyper/issues/83) I think its a good candidate to add.

I can do the implementation if you like. I'll post here my idea in case you have comments or a better idea.

Implementation idea

My idea is to add a list of missed words to the Result,

struct Result {
    ...
    missed_words: Vec<String>
}

Then add a method to create new test from missed words, something like:

impl Test {
   from_missed_words(missed: Vec<String>) -> Test {...}

and maybe call it with the option p for practice on the main loop.

I will work on a PR with this idea, let me know what you think :)