Card Queue - ghrgriner/anki-stats GitHub Wiki

Overview

This page is intended as supplementary reading to the information provided in Anki Statistical Reports. We recommend reading the Anki Statistical Reports page at least through the 'Card Type' section before reading this page.

Card Queue Details

Each card belongs to one of the following eight queues:

  • New

    • due is the order cards are shown in.
    • This only contains cards with type = New, but cards with this type could end up in other queues for the reasons listed below.
  • Learn

    • When answering and the type is set to Learn or Relearn, the queue is set to either Learn or DayLearn depending on whether card is due in less than a day. (TBD: exact criteria used).
    • due is a unix timestamp.
      • In fact, when restoring the queue from card type then cards of type Learn have the queue set to Learn or DayLearn depending on whether card.due < 1_000_000_000 or not. Cards of New type are put back in the New queue and Review type in the Review queue. Cards have their queue restored from type when:
        • Moved out of a filtered deck without being rescheduled it, either because the deck was deleted or emptied before the card was reviewed or rescheduling was not requested.
        • The card is unburied or unsuspended.
  • Review

    • due is days since creation date.
    • When answering and type is set to Review, queue is always set to Review.
    • A filtered deck with rescheduling disabled has all its cards put in Review. (TBD: it doesn't matter, but is due still days since creation in this case?)
  • DayLearn

    • See comments for Learn above
  • PreviewRepeat

    • due is a unix timestamp.
    • Preview cards (cards in a filtered deck with rescheduling disabled) are only placed here when failed.
  • Suspended, SchedBuried, UserBuried

    • Cards are not due when in any of the above queues.
    • Buried cards can be suspended. If they are then unsuspended they will be returned to their queue based on their type as described above. They would not be returned to the buried queue.
    • Suspended cards cannot be buried. If this is requested, there is no error, they simply remain in their suspended state.
    • It looks like nothing prevents a buried card from switching state to the other buried status if this is requested, but we have not tested this.
// code excerpt from Anki repository.
pub enum CardQueue {
    New = 0,
    Learn = 1,
    Review = 2,
    DayLearn = 3,
    PreviewRepeat = 4,
    Suspended = -1,
    SchedBuried = -2,
    UserBuried = -3,
}