VienDinhCom / supermemo

🧑‍🎓 A JavaScript/TypeScript implementation of the SuperMemo 2 (SM2) algorithm for spaced based repetition flashcards.
https://npm.im/supermemo
MIT License
281 stars 25 forks source link

Shouldnt calling supermemo with a poor grade keep the interval as 0? #8

Open udit99 opened 1 year ago

udit99 commented 1 year ago

Hey all In this example

let flashcard: Flashcard = {
  front: 'programer',
  back: 'an organism that turns caffeine in software',
  interval: 0,
  repetition: 0,
  efactor: 2.5,
  dueDate: dayjs(Date.now()).toISOString(),
};

console.log(flashcard);

flashcard = practice(flashcard, 1);
console.log(flashcard);

I would expect the dueDate for the flashcard to continue to be today's date, since the grade was 1 (incorrect response). In other words, I'd expect the card to remain due until the user selects 3/4/5 as the grade. At least thats is my expectation as an Anki user. Am I mistaken about how Supermemo algorithm works or am I misunderstanding something?

Thank you

Badestrand commented 2 months ago

Instinctively I would agree but according to the algorithm description itself at https://super-memory.com/english/ol/sm2.htm it is clear that the interval for an incorrect response is 1.

I(1):=1