Computing which cards are due next

lukema

Member
First, thanks for making this awesome app! I'm halfway through HSK5 and have been studying with Pleco all the way from the beginning.

I'm currently developing a Python script that computes various statistics of my Pleco database. As part of one application, I'm trying to predict a forecast of how many (and which) cards will be due on the day since the last review session (i.e. "tomorrow").

Unfortunately, when I implement the card selection algorithm following the description here, my implementation predicts too few cards (around 20 when it should be around 60).

The card selection settings I'm using
  • Repetition-spaced
  • Calendar days
  • 100 points per day
  • limit to 0 new cards per day
My python script scans the pleco_flash_scores_1 table and prints out all rows that will be due before the end of tomorrow's calendar day:
Python:
for row in pleco_flash_scores_1:
    up_to = <end of day tomorrow as timestamp> 
    wait_for = score / score_per_day * <number of seconds per day>
    if row.lastreviewedtime + wait_for < up_to:
        print("card {{row.card}} will be due tomorrow")
Am I doing something wrong about the card selection algorithm? (It's also possible that I'm getting time stamps and time zones mixed up but I'm concerned there's something more fundamental that I'm getting wrong).

----
Thanks for taking the time to read this! I feel that there's a lot of really interesting information in the pleco database that when visualized could provide interesting insights into my learning behavior.
 

mikelove

皇帝
Staff member
Thanks!

Looks right; times in the database are GMT so that certainly could explain the problem if you’re checking them against your local time.

(Also, for order-of-operations clarity: you’d want to multiply score by seconds per day and then divide by score per day)
 
Top