Skip to content

Where to store consecutiveCorrector, factor, mode, and lapses? #2

@misterbossman

Description

@misterbossman

I am having trouble getting this up and running with my collection of cards. In the instructions, it sounds like a review only needs to store:

{
  master: Id,
  combination: Combination,
  ts: Date,
  rating: Rating,
}

however, we need to procure consecutiveCorrector, factor, mode and lapses from previous reviews somehow. Don't we need to store these fields in the review (in our datastore) each time a review is created (or at minimum in a card's initial review) so that the scheduler can correctly process and space cards for future reviews?

In the dist code, I traced card state variables back to the root and it appears they all originate from a loaded review. Taking a look at the ComputeCardSchedule.test.js however, these fields are static and only defined in some card states:

    const learning: LearningCardState = {
      master,
      combination: { front: [1, 0], back: [0] },
      mode: 'learning',
      consecutiveCorrect: 0,
      lastReviewed: dates.today,
    };
    const lapsed: LapsedCardState = {
      master,
      combination: { front: [1, 0], back: [0, 1] },
      mode: 'lapsed',
      consecutiveCorrect: 0,
      lastReviewed: dates.today,
      factor: 1000,
      interval: 0,
      lapses: 1,
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions