Update the due field after importing a new deck

Hi again!

Some time ago I created a small web based Korean online dictionary with build support to enable the creation of .apkg files. These initial decks get imported and added to one Anki deck consecutively. I decided not to make use of add-ons like AnkiConnect because most of the time when I create new cards I do that when I am not in front of a computer but a phone.

As mentioned in the description of the Anki database scheme here and Ankis source code itself, every card in the deck is assigned the following values:

type = 0
queue = 0
due = 0

My problems right now is the following:

  • Whenever I study cards of that deck the newest cards are presented first.
  • New cards are introduced one sided i.e. all new Front cards are shown and only after finishing these the Back cards appear.

All the Anki related code of said project can be found on Github here and here.

The order of cards only gets fixed when changing the order of cards to random and then back to sequential.

I would like it that per study session (with a example setting of 10 new allowed cards per day) both sides of 5 notes (Front and Back) are shown randomly, but no other cards from notes not to be studied in that specific study session.