genanki
genanki copied to clipboard
[FEATURE REQUEST] Generate due date order
Currently when generating decks with genanki all the cards have the due date/order of 0. This can be seen when viewing the deck in the browser.
Would be great to auto-generate the due order within the code if possible or to be able to set the start so that it would start counting from the value given instead of zero.
This is particularly helpful when auto generating flashcards for a course where learning order makes it easier to learn.
Again, would be happy to do a pull request if given guidance on where to insert what in the relevant sections of the codebase.
I just tested this locally and it should be fairly straightforward -- we just need to be able to pass due as an argument to Card::write_to_db: https://github.com/kerrickstaley/genanki/blob/fc8148ab5cabeb16e8957ebb3e7d8ec48bed7cf5/genanki/card.py#L6-L27
Quick PR to prove out the idea: https://github.com/kerrickstaley/genanki/pull/80
@z1lc thanks for taking a look and for making a pull request, there appears to be an error in the pull request. Could you take a look and see if you can resolve it?
It may help to make it easier to merge your pull request
The Travis checks were erroring out and I've switched this repo to use GitHub Actions anyway. I disabled Travis on master and merged master into @z1lc's branch, and it looks like tests are passing now. I'll review the PR.
@kerrickstaley I think we can close this issue thanks to our PR? Forgot to mention it in the description so this wasn't auto-resolved.
How does the due field work? I attempted to set it to the number of days until the card is due using an integer, but when I import the deck into Anki, all cards are marked as "New". Is this a bug or do I have to mark the cards specifically as being "not-new"?