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

Remember how many cards we've learned today even after re-opening the app #110

Merged
merged 9 commits into from
Mar 3, 2019

Commits on Feb 23, 2019

  1. Remember how many cards we learned today

    When we close the mnemosyne application and re-open it, it won't
    remember the number of the already memorized cards. In other words, it
    won't warn you if you've already learned 15 or more words.
    
    This PR aims to fix this issue and re-construct the
    `self._fact_ids_memorised` from the logs.
    
    We can fetch all the newly learned cards and all the forgotten but
    learned cards today. Combining the two, we can get the number of the
    learned cards today.
    woohgit committed Feb 23, 2019
    Configuration menu
    Copy the full SHA
    b3a3f2d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    17b8f3a View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2019

  1. Fix edge case of calling reset and getting an alert

    When saving the Settings dialog, the `reset` is alwas called, so it 
    would trigger an alert every time when, because during the reset 
    function, the `warned_about_too_many_cards` is reset to 
    `warned_about_too_many_cards = False`. 
    
    This fix initializes the `warned_about_too_many_cards` on the class 
    level, and calling  `reset` won`t reset it back to `False`.
    
    Also only warn when we've just reached the 15 new or forgotten words.
    woohgit committed Feb 25, 2019
    Configuration menu
    Copy the full SHA
    7639d5f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0c7f89f View commit details
    Browse the repository at this point in the history
  3. Only warn once per day

    Add a new event type: `WARNED_TOO_MANY_CARDS` so we can query from the 
    log table if the warning has been already shown or not.
    - Add test coverage
    woohgit committed Feb 25, 2019
    Configuration menu
    Copy the full SHA
    9b2f9ad View commit details
    Browse the repository at this point in the history
  4. Don't need to warn on start-up

    Warning on start-up would be only useful if we could alert more than 
    once a day. If we already displayed a warning, we should never show the 
    warning again on start-up.
    woohgit committed Feb 25, 2019
    Configuration menu
    Copy the full SHA
    639fa7f View commit details
    Browse the repository at this point in the history
  5. Fix comparing unordered tests

    Python lists are unordered, so comparing them will result in a random 
    result.
    
    Using `sort()` will ensure that the elements are ordered so we can 
    compare them properly. Using sort is `O(n log n)`.
    woohgit committed Feb 25, 2019
    Configuration menu
    Copy the full SHA
    849445e View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2019

  1. Code clean up

    - Move sql queries to the database class
    - Add test coverage for the new database API functions
    - adjusting the variable naming to comply with the current naming scheme
    woohgit committed Mar 2, 2019
    Configuration menu
    Copy the full SHA
    58204e0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ff01df7 View commit details
    Browse the repository at this point in the history