From a1b0ddb00c89c28a664eb56fd8a811edf3c20951 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 7 Aug 2017 18:38:35 +1000 Subject: [PATCH] experiment with displaying FrontSide under answer - avoids having to move eyes to answer section - the fade out/fade in step feels more natural when the question section moves feedback welcome --- anki/collection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anki/collection.py b/anki/collection.py index 7d644b6e6..819b47f40 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -529,6 +529,9 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)): format = re.sub("{{(.*?)cloze:", r"{{\1ca-%d:" % (data[4]+1), format) format = format.replace("<%cloze:", "<%%ca:%d:" % ( data[4]+1)) + format = re.sub(r"^{{FrontSide}}\s*?
(.*)$", + "\\1
{{FrontSide}}", + format, flags=re.DOTALL) fields['FrontSide'] = stripSounds(d['q']) fields = runFilter("mungeFields", fields, model, data, self) html = anki.template.render(format, fields)