Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Cloze note type #3

Closed
kerrickstaley opened this issue Feb 14, 2017 · 5 comments
Closed

Support Cloze note type #3

kerrickstaley opened this issue Feb 14, 2017 · 5 comments

Comments

@kerrickstaley
Copy link
Owner

Cloze notes are great, let's do that.

@qwiglydee
Copy link

Isn't it just a matter of type: 1 in models?

@kerrickstaley
Copy link
Owner Author

Yes, it should be. But ideally I want to add a nice-to-use interface for creating Cloze notes.

@kerrickstaley
Copy link
Owner Author

(Pull requests welcome!)

@mtherieau
Copy link

mtherieau commented May 22, 2018

I worked on this a bit and it's more than just type: 1 in models. Each cloze note can generate multiple cards. When generating Cards from a cloze Note, first the Model's template/qfmt field needs to be scanned to find fields that are marked with "cloze:" prefix. Then each of these fields in the Note needs to be scanned to find "cN::" cloze references. A Card needs to be created for each unique "N" ordinal cloze reference. Here's a working example that extends genanki.Note and genanki.Card to support cloze notes. https://gist.github.com/mtherieau/356445199db23daa776010710c68852a (fyi: I lifted the cloze regexes from anki)

@kerrickstaley
Copy link
Owner Author

Fixed in #37, won't get around to releasing it until later though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants