diff --git a/anki/models.py b/anki/models.py index 950514932..efc7461ec 100644 --- a/anki/models.py +++ b/anki/models.py @@ -49,7 +49,6 @@ defaultTemplate = { 'ord': None, 'qfmt': "", 'afmt': "", - 'typeAns': None, 'did': None, } diff --git a/anki/template/template.py b/anki/template/template.py index a165b4799..ec9c67b40 100644 --- a/anki/template/template.py +++ b/anki/template/template.py @@ -157,6 +157,10 @@ class Template(object): if txt: return stripHTML(txt) return "" + elif tag_name.startswith("type:"): + # type answer field; convert it to [[type:...]] for the gui code + # to process + return "[[%s]]" % tag_name elif (tag_name.startswith("cq:") or tag_name.startswith("ca:") or tag_name.startswith("cactx:")): diff --git a/anki/upgrade.py b/anki/upgrade.py index c574f17f2..56a432ccd 100644 --- a/anki/upgrade.py +++ b/anki/upgrade.py @@ -374,7 +374,6 @@ order by ordinal""", mid)): db = self.db dconf = anki.models.defaultTemplate tmpls = [] - # align and bg are used in upgrade then discarded for c, row in enumerate(db.all(""" select name, active, qformat, aformat, questionInAnswer, questionAlign, lastFontColour, typeAnswer from cardModels @@ -385,14 +384,12 @@ order by ordinal""", mid)): conf['actv'], conf['qfmt'], conf['afmt'], + # the following are used in upgrade then discarded hideq, conf['align'], conf['bg'], - conf['typeAns']) = row + typeAns) = row conf['ord'] = c - # q fields now in a - if not hideq: - conf['afmt'] = conf['qfmt'] + "\n\n