mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
make question replaying a deck property; add exclude arg to play
This commit is contained in:
parent
d47dfc1780
commit
5c8f45b2c4
3 changed files with 6 additions and 3 deletions
|
@ -33,7 +33,6 @@ defaultConf = {
|
||||||
'sortType': "noteFld",
|
'sortType': "noteFld",
|
||||||
'sortBackwards': False,
|
'sortBackwards': False,
|
||||||
'addToCur': True, # add new to currently selected deck?
|
'addToCur': True, # add new to currently selected deck?
|
||||||
'replayBoth': True, # include question when replaying answer?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# this is initialized by storage.Collection
|
# this is initialized by storage.Collection
|
||||||
|
|
|
@ -73,6 +73,7 @@ defaultConf = {
|
||||||
'maxTaken': 60,
|
'maxTaken': 60,
|
||||||
'timer': 0,
|
'timer': 0,
|
||||||
'autoplay': True,
|
'autoplay': True,
|
||||||
|
'replayq': True,
|
||||||
'mod': 0,
|
'mod': 0,
|
||||||
'usn': 0,
|
'usn': 0,
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,12 @@ from anki.utils import namedtmp, tmpdir, isWin, isMac
|
||||||
# Shared utils
|
# Shared utils
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def playFromText(text):
|
def playFromText(text, exclude=""):
|
||||||
|
reg = "\[sound:(.*?)\]"
|
||||||
fnames = {}
|
fnames = {}
|
||||||
for match in re.findall("\[sound:(.*?)\]", text):
|
for match in re.findall(reg, exclude):
|
||||||
|
fnames[match] = True
|
||||||
|
for match in re.findall(reg, text):
|
||||||
if match in fnames:
|
if match in fnames:
|
||||||
continue
|
continue
|
||||||
fnames[match] = True
|
fnames[match] = True
|
||||||
|
|
Loading…
Reference in a new issue