From 3b20de173f8f9313234899224f9b71c057039930 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 30 Jan 2014 00:34:42 +0900 Subject: [PATCH] preserve order in multi cloze type answer; bump version --- anki/__init__.py | 2 +- aqt/reviewer.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/anki/__init__.py b/anki/__init__.py index fb180dbee..fdbd9596d 100644 --- a/anki/__init__.py +++ b/anki/__init__.py @@ -30,6 +30,6 @@ if arch[1] == "ELF": sys.path.insert(0, os.path.join(ext, "py2.%d-%s" % ( sys.version_info[1], arch[0][0:2]))) -version="2.0.21" # build scripts grep this line, so preserve formatting +version="2.0.22" # build scripts grep this line, so preserve formatting from anki.storage import Collection __all__ = ["Collection"] diff --git a/aqt/reviewer.py b/aqt/reviewer.py index eb74ecb13..79216e00b 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -434,7 +434,14 @@ Please run Tools>Empty Cards""") return txt matches = [noHint(txt) for txt in matches] if len(matches) > 1: - txt = ", ".join(list(set(matches))) + arr = [] + seen = {} + for m in matches: + if m in seen: + continue + seen[m] = 1 + arr.append(m) + txt = ", ".join(arr) else: txt = matches[0] return txt