Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "practice missed words" mode #89

Merged
merged 2 commits into from
Sep 19, 2023

Commits on Aug 16, 2023

  1. 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),
    }
    ```
    glazari committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    f381b8b View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2023

  1. Address PR comments

    glazari committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    676d351 View commit details
    Browse the repository at this point in the history