Hi,
This is old code, in the new version this reads as follows:
if new_grade == 2 or new_grade == 3:
if timing in ["ON TIME", "EARLY"]:
new_interval = actual_interval * card.easiness
else:
# Learning late and interval was too long, so don't
# increase the interval and use scheduled_interval
# again as opposed to the much larger
# actual_interval * card.easiness.
new_interval = scheduled_interval
Which does the same, but it hopefully a bit more self explanatory.
What we are doing in this code is making certain provisions for when we
are either learning a card a card ahead of schedule or too late.
Peter
On 02/19/2013 12:16 AM, Vit wrote:
> Hello Peter.
> Would you please explain this code.
>
> Here's the relevant code:
>
> if new_grade == 2 or new_grade == 3:
> if *actual_interval* <= scheduled_interval: