The correct way to get the next question in the deck

Hi There,
I am using python to query anki to simulate the Anki “study” operation using the find_cards operation.
In Anki, When we click study in Anki, Anki displays question and when we choose the answer level, it displays the next question. I am trying to do the same to get next question

I am facing trouble in simulating this retrieving next question from python.
I am always getting the same question when I click Again or Hard. So seeking help to understand if the filter to get the next pending question needs any correction

The filter that I am using is like below

col.find_cards(“deck:MyDeck (is:new or is:learn or is:due)”)[0]

I have made sure the Type, Rating and Interval are changing properly in Anki. (Verified in through the Card info in the properties) .
However, when I try to get next question from the above filter, I still get the same question.

Could you please check and confirm if this needs any change or if this filter is correct to get the next question for the study?

Maybe you can just use a loop?

for card in col.find_cards("deck:MyDeck (is:new or is:learn or is:due)"):
display(card)

where display is some function you define.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.