st3v3nmw / obsidian-spaced-repetition Public
generated from obsidianmd/obsidian-sample-pluginNew 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
Properly handle reviewing ahead #129
Labels
Projects
Comments
|
Anki algorithm (source): def _earlyReviewIvl(self, card: Card, ease: int) -> int:
assert card.odid and card.type == CARD_TYPE_REV
assert card.factor
assert ease > 1
elapsed = card.ivl - (card.odue - self.today)
#// elapsed: number of days that have passed since you reviewed the card
#// card.ivl: card's given interval
#// card.odue: card's original due date
#// self.today: today date
conf = self._revConf(card)
easyBonus = 1
# early 3/4 reviews shouldn't decrease previous interval
minNewIvl = 1
if ease == BUTTON_TWO: #// if you press hard
factor = conf.get("hardFactor", 1.2)
#// hardFactor: should
# hard cards shouldn't have their interval decreased by more than 50%
# of the normal factor
minNewIvl = factor / 2
elif ease == BUTTON_THREE: #// if you press good
factor = card.factor / 1000
else: # ease == BUTTON_FOUR: #// if you press easy
factor = card.factor / 1000
ease4 = conf["ease4"]
#// ease4: should be the ease bonus (review tab in deck options) not sure tho
# 1.3 -> 1.15
easyBonus = ease4 - (ease4 - 1) / 2
ivl_1 = max(elapsed * factor, 1)
#// card.factor: if ease = 250%, card.factor = 2500
#// factor: if ease = 250%, factor = 2.5
# cap interval decreases
ivl_2 = max(card.ivl * minNewIvl, ivl_1) * easyBonus
ivl_3 = self._constrainedIvl(ivl_2, conf, prev=0, fuzz=False)
#// self._constrainedIvl -> applies fuzz,checks for maximum interval cap,
#// checks for previous interval and does one more thing that i honestly don't understand :/
#// for review ahead, fuzz is false (no fuzz applies)
#// previous interval = 0, maximum is always the interval that this function gives it
#// so i'll just assume that it has no effect on the interval and just use this function in my example (:|)
return ivl_3
#// returns new interval for the cardif you press hard: if you press good: if you press easy: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.ankiweb.net/filtered-decks.html#reviewing-ahead
The text was updated successfully, but these errors were encountered: