From 253d429a8bec572922b118fe4e3c82fad22d6e0d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 3 Jan 2020 13:40:50 +1000 Subject: [PATCH] drop 'extra' from default cloze note type Too many users get confused about where they should be placing the cloze deletions. --- pylib/anki/stdmodels.py | 4 +--- pylib/tests/test_models.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pylib/anki/stdmodels.py b/pylib/anki/stdmodels.py index 8d887b263..a767d802e 100644 --- a/pylib/anki/stdmodels.py +++ b/pylib/anki/stdmodels.py @@ -101,8 +101,6 @@ def addClozeModel(col) -> NoteType: txt = _("Text") fm = mm.newField(txt) mm.addField(m, fm) - fm = mm.newField(_("Extra")) - mm.addField(m, fm) t = mm.newTemplate(_("Cloze")) fmt = "{{cloze:%s}}" % txt m[ @@ -116,7 +114,7 @@ def addClozeModel(col) -> NoteType: color: lightblue; }""" t["qfmt"] = fmt - t["afmt"] = fmt + "
\n{{%s}}" % _("Extra") + t["afmt"] = fmt mm.addTemplate(m, t) mm.add(m) return m diff --git a/pylib/tests/test_models.py b/pylib/tests/test_models.py index 177579f4e..f07d51eef 100644 --- a/pylib/tests/test_models.py +++ b/pylib/tests/test_models.py @@ -331,6 +331,7 @@ def test_modelChange(): # back the other way, with deletion of second ord deck.models.remTemplate(basic, basic["tmpls"][1]) assert deck.db.scalar("select count() from cards where nid = ?", f.id) == 2 + map = {0: 0} deck.models.change(cloze, [f.id], basic, map, map) assert deck.db.scalar("select count() from cards where nid = ?", f.id) == 1