don't require fields in cloze del model; remove extra brackets in cloze hints

This commit is contained in:
Damien Elmes 2011-12-17 15:02:15 +09:00
parent 60643b5b1f
commit 619a58216a
2 changed files with 2 additions and 1 deletions

View file

@ -438,6 +438,7 @@ select id from notes where mid = ?)""" % " ".join(map),
cloze += "{{c%d::foo}}" % n
# record that we require a specific string for generation
reqstrs.append("{{c%d::" % n)
return 'all', [], reqstrs
for f in flds:
a.append(cloze if cloze else "1")
b.append("")

View file

@ -180,7 +180,7 @@ class Template(object):
# replace chosen cloze with type
if type == "q":
if m.group(2):
txt = re.sub(reg%ord, "<span class=cloze>[...(\\3)]</span>", txt)
txt = re.sub(reg%ord, "<span class=cloze>[...\\3]</span>", txt)
else:
txt = re.sub(reg%ord, "<span class=cloze>[...]</span>", txt)
elif type == "a":