mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -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",
|
||||
'sortBackwards': False,
|
||||
'addToCur': True, # add new to currently selected deck?
|
||||
'replayBoth': True, # include question when replaying answer?
|
||||
}
|
||||
|
||||
# this is initialized by storage.Collection
|
||||
|
|
|
@ -73,6 +73,7 @@ defaultConf = {
|
|||
'maxTaken': 60,
|
||||
'timer': 0,
|
||||
'autoplay': True,
|
||||
'replayq': True,
|
||||
'mod': 0,
|
||||
'usn': 0,
|
||||
}
|
||||
|
|
|
@ -10,9 +10,12 @@ from anki.utils import namedtmp, tmpdir, isWin, isMac
|
|||
# Shared utils
|
||||
##########################################################################
|
||||
|
||||
def playFromText(text):
|
||||
def playFromText(text, exclude=""):
|
||||
reg = "\[sound:(.*?)\]"
|
||||
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:
|
||||
continue
|
||||
fnames[match] = True
|
||||
|
|
Loading…
Reference in a new issue