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

Add "Back Extra" field to Cloze builtin model #101

Merged
merged 7 commits into from
Jan 4, 2022

Conversation

kerrickstaley
Copy link
Owner

Due to a mistake, the "Back Extra" field was omitted from genanki.builtin_models.CLOZE_MODEL. This field shows extra information on the back of the card.

Add this field to CLOZE_MODEL. Also, add some code that runs inside Note.write_to_db that checks if .fields has only one element and .model is CLOZE_MODEL, and if so, fixes .fields and emits a warning.

This change may cause minor backwards-incompatibility issues, because the ID of CLOZE_MODEL has changed. The only visible effect should be that a deck of Cloze notes created before this change and a similar deck created after this change will have different Note Types when both are imported into Anki. (Note Type is the Anki UI's term for what the source code calls Model).

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2022

Codecov Report

Merging #101 (e1369a9) into master (e308e37) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #101      +/-   ##
==========================================
+ Coverage   95.28%   95.41%   +0.12%     
==========================================
  Files          11       11              
  Lines         318      327       +9     
==========================================
+ Hits          303      312       +9     
  Misses         15       15              
Impacted Files Coverage Δ
genanki/builtin_models.py 100.00% <100.00%> (ø)
genanki/note.py 97.45% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e308e37...e1369a9. Read the comment docs.

@kerrickstaley kerrickstaley merged commit 9ba9392 into master Jan 4, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants