I’m currently trying to write an add-on which automatically does the first review of cards added in the Add Cards dialog. I’m not the most experienced with Anki and Python, so I’m having troubles to understand why the following does not work:
mw.col.sched.answerCard(mw.col.getCard(1605091898523), 3)
Note that I just wanted to do a small test with a random card of my collection
Anki 2.1.36 (53a984ba) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.7
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-11-10 13:12:15
Add-ons possibly involved: add-card-do-first-review
Caught exception:
Traceback (most recent call last):
File "anki/sched.py", line 368, in _logLrn
File "anki/sched.py", line 363, in log
File "anki/cards.py", line 184, in timeTaken
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aqt/webview.py", line 508, in handler
File "aqt/editor.py", line 483, in <lambda>
File "aqt/addcards.py", line 191, in _addCards
File "aqt/addcards.py", line 183, in addNote
File "aqt/gui_hooks.py", line 46, in __call__
File "/Users/p4nix/Library/Application Support/Anki2/addons21/add-card-do-first-review/__init__.py", line 37, in added_note
mw.col.sched.answerCard(mw.col.getCard(1605091898523), 3)
File "anki/sched.py", line 75, in answerCard
File "anki/sched.py", line 275, in _answerLrnCard
File "anki/sched.py", line 372, in _logLrn
File "anki/sched.py", line 363, in log
File "anki/cards.py", line 184, in timeTaken
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
Whereas mw.col.sched.answerCard(mw.col.sched.getCard(), 3)
works for rescheduling the latest card in the scheduler?