anki_progress_stats icon indicating copy to clipboard operation
anki_progress_stats copied to clipboard

Graph not displaying correct number of learned cards

Open DrSchwifty opened this issue 4 years ago • 2 comments
trafficstars

I love this add-on and have been using it for a while now, but recently I've noticed on Anki 2.1.26 the graph isn't showing the correct number of cards learned. For instance if I have 1,000 unsuspended cards in a deck and limit it to learning 100 cards per day and I do those 100 cards the graph only displays that I've done ~75 cards. I think its not counting the cards that I hit easy on the first time I see the card, but I'm not sure.

DrSchwifty avatar Jan 14 '21 23:01 DrSchwifty

Sorry I forgot to respond to this.

I think its not counting the cards that I hit easy on the first time I see the card, but I'm not sure.

This is a useful observation. I wonder if there is a bug here. I'm going to do some testing and will get back to you.

matthayes avatar Apr 03 '21 05:04 matthayes

I reviewed the code and did some testing. I looked at some cards in the data where I had hit easy on the first time seeing it. There could still be an issue, but the logic in the code seems correct to me based on what I'm observing in the data. Maybe there is some difference with the review history in Anki 2.1.26. When you learn the 100 cards, are you completing all the learning steps for the cards as well? If the card is not considered learned until it completes all the learning steps. If you're willing to share your deck with me I could check the review history to see if there is an issue.

In case you're curious about what I was looking into, there is a piece of code (below) that checks whether one of the reviews in the queried reviews for a card is the first time it was learned. I confirmed for my data that when if I hit easy on the first time seeing a card the new interval is positive and the last interval is negative.

    for review in card_reviews.reviews:
        if review.lastIvl < 0 and review.ivl > 0 and review.id == review.first_learned_id:
            return True

    return False

https://github.com/matthayes/anki_progress_stats/blob/master/progress_stats/compute.py#L196

matthayes avatar Apr 03 '21 07:04 matthayes