5

Is there an example on how to invoke the Anki testing from ipython and answer it?

I am going trough this: https://github.com/dae/anki

but I am not able to do it. In the example below, I am importing a collection, and trying to start testing but the scheduler will return None on a .getCard() item.

from anki import Collection
from anki.importing.apkg import AnkiPackageImporter

coll = Collection('aaa1.anki2')
ti = AnkiPackageImporter(col=coll,file = r"ppp.apkg")
ti.run()
aa = ti.col.sched.getCard()
print(aa)

and aa is None...

I am trying to learn how Anki works internally, so I can use it in my own app (I am trying to build a simple web quiz with a time limit on each question for multiple users & compare their performance over time.)

johan
  • 1,664
  • 2
  • 14
  • 30
Hynek Los kamute
  • 566
  • 1
  • 4
  • 15
  • 2
    Writing in all all-lowercase looks very tacky. Bad habit. – clearlight Feb 03 '17 at 00:30
  • Thx, will think about that next time. – Hynek Los kamute Feb 03 '17 at 14:24
  • A lot of people don't like it. You'll scare away the help you want :-) It was (again) a recent discussion on the StackExchange / StackOverflow Meta site where the community, moderators and the company discuss the the aspects of handling things that go on at the site. http://meta.stackoverflow.com/questions/342510/lowercase-epidemic – clearlight Feb 03 '17 at 20:50
  • If it were *me*, I would take the advice of someone who's been around for awhile and edit my answer and fix it in the hopes that more people might want to help (doesn't guarantee it will happen), ... but that's just me. I try to be stubborn only about the right things, not about the wrong things, or in a self-defeating way. Good luck! – clearlight Feb 03 '17 at 20:52

0 Answers0