diff --git a/anki/stdmodels.py b/anki/stdmodels.py index f1ab0a1b7..aa754631d 100644 --- a/anki/stdmodels.py +++ b/anki/stdmodels.py @@ -26,6 +26,25 @@ def addBasicModel(col): models.append((lambda: _("Basic"), addBasicModel)) +# Basic w/ typing +########################################################################## + +def addBasicTypingModel(col): + mm = col.models + m = mm.new(_("Basic (type in the answer)")) + fm = mm.newField(_("Front")) + mm.addField(m, fm) + fm = mm.newField(_("Back")) + mm.addField(m, fm) + t = mm.newTemplate(_("Card 1")) + t['qfmt'] = "{{"+_("Front")+"}}\n{{type:"+_("Back")+"}}" + t['afmt'] = "{{FrontSide}}\n\n
\n\n"+"{{"+_("Back")+"}}" + mm.addTemplate(m, t) + mm.add(m) + return m + +models.append((lambda: _("Basic (type in the answer)"), addBasicTypingModel)) + # Forward & Reverse ########################################################################## diff --git a/anki/storage.py b/anki/storage.py index fe2006846..b6ca539dc 100644 --- a/anki/storage.py +++ b/anki/storage.py @@ -11,7 +11,7 @@ from anki.db import DB from anki.collection import _Collection from anki.consts import * from anki.stdmodels import addBasicModel, addClozeModel, addForwardReverse, \ - addForwardOptionalReverse + addForwardOptionalReverse, addBasicTypingModel def Collection(path, lock=True, server=False, sync=True, log=False): "Open a new or existing collection. Path must be unicode." @@ -43,6 +43,7 @@ def Collection(path, lock=True, server=False, sync=True, log=False): elif create: # add in reverse order so basic is default addClozeModel(col) + addBasicTypingModel(col) addForwardOptionalReverse(col) addForwardReverse(col) addBasicModel(col)