kerrickstaley / genanki

A Python 3 library for generating Anki decks
MIT License
1.99k stars 150 forks source link

set due field for cards to position of the coresponding note inside the deck #67

Closed mi-ael closed 2 years ago

mi-ael commented 3 years ago

when using more then 1 template the order of new cards currently is the following: note 1 template 1 note 2 template 1 note 3 template 1 note 1 template 2 note 2 template 2 note 3 template 2

this is probably not what most people want. E.g. when creating decks for language learning you usually have 2 templates (one for "eng->other language" and one for "other language->eng") and the card with the second template should appear right after the first.

this fix changes the order to: note 1 template 1 note 1 template 2 note 2 template 1 note 2 template 2 note 3 template 1 note 3 template 2

the behavior for decks with just 1 template remains unchanged

Merovius commented 2 years ago

@kerrickstaley Friendly ping on this? :) I just used genanki for the first time and ran into exactly this problem and used a similar mechanism to fix it. So, I'd really like this (or something like it) to be upstreamed, for future decks I want to generate.

FWIW, I'm not entirely sure this is the best fix - in particular, I don't know how it interacts when you re-generate and re-import a deck after you already learned for a while (say you discover an issue with the generator or want to generate more cards in the middle of learning this deck), because AIUI this might break the scheduling in that situation? I'm not sure. But something to change the scheduling this way would be nice.

yash-fn commented 2 years ago

This PR should be closed by either @kerrickstaley or @mi-ael . It appears to already have been inserted into the codebase via utilizing the note class's self.due attribute.

mi-ael commented 2 years ago

already implemented in a different pull request