keep typeAns as a field name

We have the fact loaded into memory anyway for the q/a display
This commit is contained in:
Damien Elmes 2011-11-19 23:36:40 +09:00
parent 7a5cee1d20
commit 4a601416bc

View file

@ -397,16 +397,6 @@ order by ordinal""", mid)):
# q fields now in a # q fields now in a
if not hideq: if not hideq:
conf['afmt'] = conf['qfmt'] + "\n\n<hr>\n\n" + conf['afmt'] conf['afmt'] = conf['qfmt'] + "\n\n<hr>\n\n" + conf['afmt']
# convert the field name to an ordinal
ordN = None
for (ord, fm) in enumerate(flds):
if fm['name'] == conf['typeAns']:
ordN = ord
break
if ordN is not None:
conf['typeAns'] = ordN
else:
conf['typeAns'] = None
for type in ("qfmt", "afmt"): for type in ("qfmt", "afmt"):
# ensure the new style field format # ensure the new style field format
conf[type] = re.sub("%\((.+?)\)s", "{{\\1}}", conf[type]) conf[type] = re.sub("%\((.+?)\)s", "{{\\1}}", conf[type])