Unexpected results with Deck Options > Descending position

I’ve founded unexpected results when working with a deck with several subdecks. To simplify, I will use this test deck:



(If anyone is interested it can be downloaded from here)

There are three subdecks, each with three cards. All cards are new, created sequentially and positioned #1 to #9. All decks use standard deck options, except that new cards / day is set to 6.

Now, if I want to study the Test deck deck by deck, I could use, for example, these settings (EXAMPLE A):


I expect Anki to show the new cards in this order: A1 > A2 > A3 > B1 > B2 > B3
Actual result: A1 > A2 > A3 > B1 > B2 > B3 > OK


Same result with these settings (EX. B):


Expected result: A1 > A2 > A3 > B1 > B2 > B3
Actual result: A1 > A2 > A3 > B1 > B2 > B3 > OK


Now, if I want Anki to show me first the last cards, I would use these settings (EX. C):


Expected result: C3 > C2 > C1 > B3 > B2 > B1
But the actual results are: A3 > A2 > A1 > B3 > B2 > B1 > ?


Same here (EX D):


Expected result: B3 > B2 > B1 > A3 > A2 > A1
But the actual results are: A3 > A2 > A1 > B3 > B2 > B1 > ?
EDIT: that was probably my fault: actual results are B3 > B2 > B1 > A3 > A2 > A1 > OK


And here (EX. E):


Expected result: B1 > B2 > B3 > C1 > C2 > C3
Actual result: A1 > A2 > A3 > B1 > B2 > B3 > ?


BUT, if I use these settings, it works (EX. F):


Expected result: C3 > C2 > C1 > B3 > B2 > B1
Actual result: C3 > C2 > C1 > B3 > B2 > B1 > OK


I’m not sure if this is a bug, or user error, probably I’m just missing something obvious here. Any help?,

PS: Using 2.1.49, no add-ons

1 Like

I can reproduce all your examples except this: It gives me C3 > C2 > C1 > B3 > B2 > B1 > …, which I think is the expected result?

1 Like

Thanks, Abdo for taking a look.
That’s strange. I’ve tried the example D) again and this time, I got the results I was expecting:
B3 > B2 > B1 > A3 > A2 > A1
(My understanding is that in this case, Anki will gather new cards in Deck order (cards A1, A2, A3, B1, B2, B3) and show them in descending position (B3 > B2 > B1 > A3 > A2 > A1))

However, I’ve tried examples C and E (and other similar settings) again, with the same results as above.

1 Like

You’re right. I didn’t pay attention to the fact that you set the New Cards / Day setting to 6 and used the default limit instead :sweat_smile:

I also got B3 > B2 > B1 > A3 > A2 > A1 after testing again.

1 Like

After further testing, I think the problem boils down to this specific option:

With this setting, in the example, I would expect Anki to gather cards C3, C2, C1, B3, B2, B1 and show that cards according to the order selected here:

Actually, however, Anki will also gather A1, A2 and A3 cards EXCEPT when using:

  • “Card template, then descending position”
  • “Descending position”

@dae After a brief look at the code here, It seems to me that Anki is gathering new cards from the selected deck’s tree sequentially and applying the ascending/descending position order to each individual deck, which is resulting in the behavior seen in Example E for example.

1 Like

For performance reasons, new cards are always fetched deck-by-deck. The difference in deck vs position is that in deck fetching mode, Anki stops as soon as the selected deck limit is reached. In the other modes, cards are gathered from every deck, and then they are sorted.

Sorry, but I still dont get it, probably being dumb here :sweat_smile:

A) Doesn’t that contradict the info here?

image

B) Why example F works as expected, but example E doesn’t?

To clarify, what I was expecting is that, if I have 9 cards in subdecks A, B, C, in this order:
A1, A2, A3, B1, B2, B3, C1, C2, C3
…and a limit of 6 new cards a day:

  • New card gather order > Deck: will gather 6 cards in deck order (A1, A2, A3, B1, B2, B3) and sort them according to the “New card sort order” setting.
  • New card gather order > Ascending position: will gather 6 cards in ascending position (A1, A2, A3, B1, B2, B3) and sort them according to the “New card sort order” setting.
  • New card gather order > Descending position: will gather 6 cards in descending position (C3, C2, C1, B3, B2, B1) and sort them according to the “New card sort order” setting.

Where am I wrong?

If the Position description started with “When combined with an appropriate sort order”, would that make things clearer?

The sort order still needs to be to to ascending/descending position if you want cards to show in that order. The difference with the “deck” setting in that it stops as soon as the daily limit has been reached, so cards that were in later decks may not appear if the limited is reached. The other two options take each deck’s limit worth of cards from the start or end of the queue, and then sorting happens after they’ve all been gathered.

Yes, probably, but the truth is that I’m suffering a serious case of mental block here: it’s obvious that these options work as they should, it’s just me who just can’t see the logic behind. I’ll try again in a few weeks! :sweat_smile:

1 Like