Re-learning interval max

Hello, I am trying to figure out how to use JavaScript for V3 scheduler. I am wondering if there is a way to set a max re-learning interval.

I have the relearning new interval set at 50%. This works great for cards with an interval of 1 month, when I click Again they go to two weeks. However for cards with longer intervals like 1 year, the new interval will be set at 6 months which is far too long (if I did not remember it now, I won’t remember it from today’s review in 6 months from now).

I am wondering if there is JavaScript I can use in the custom scheduling section to limit the maximum days for a new interval, for example set it to 20 days.

Thanks!

It is possible.

Firstly, you need to check whether current card is in relearning stage.

function is_relearning() {
  if (states.current.normal?.relearning !== undefined) {
    if (states.current.normal?.relearning !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'relearning')) {
      return true;
    }
  }
  return false;

Then, you need to get the interval of re-learning interval.

  if (states.good.normal?.review) {
    good_interval = states.good.normal.review.scheduledDays;
  }
  if (states.easy.normal?.review) {
    easy_interval = states.easy.normal.review.scheduledDays;
  }

Now, you can set limit for these interval.

I write a custom scheduling code for Anki. You can learn more from it:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.