mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
New cards of existing note take due value of NEW siblings
Here is a bug, how to reproduce it, and why this is a fix. This is a way to create a new note with a due card extremly high without any add-on, just with basic anki. Bug === Create a note type with three fields One, Two, and Three and three card type One, Two and Three such that each card is generated when the field of the same name is filled. Create a note with fields One and Two filled only. Review card One and click on good. Card one should goes in learning mode. Fill the field Three. In the browser, you'll see that card Two and Three are new, but card Two and Three's due value are distinct. More precisely, the due value of card Three is equal to the due value of card One; except that in card One it's interpreted as a timestamp, while in card Three it's interpreted as a position in the list of new card. You'll remark by the way that the due of card Three is extremly high, potentially more than 1000000; which may explain why so many collection has this bug. Fix === Only consider due value of new cards.
This commit is contained in:
parent
2e7b756000
commit
3f45de87b3
1 changed files with 4 additions and 3 deletions
|
@ -354,8 +354,8 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
||||||
have = {}
|
have = {}
|
||||||
dids = {}
|
dids = {}
|
||||||
dues = {}
|
dues = {}
|
||||||
for id, nid, ord, did, due, odue, odid in self.db.execute(
|
for id, nid, ord, did, due, odue, odid, type in self.db.execute(
|
||||||
"select id, nid, ord, did, due, odue, odid from cards where nid in "+snids):
|
"select id, nid, ord, did, due, odue, odid, type from cards where nid in "+snids):
|
||||||
# existing cards
|
# existing cards
|
||||||
if nid not in have:
|
if nid not in have:
|
||||||
have[nid] = {}
|
have[nid] = {}
|
||||||
|
@ -375,7 +375,8 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
||||||
# save due
|
# save due
|
||||||
if odid != 0:
|
if odid != 0:
|
||||||
due = odue
|
due = odue
|
||||||
if nid not in dues:
|
if nid not in dues and type == 0:
|
||||||
|
# Add due to new card only if it's the due of a new sibling
|
||||||
dues[nid] = due
|
dues[nid] = due
|
||||||
# build cards for each note
|
# build cards for each note
|
||||||
data = []
|
data = []
|
||||||
|
|
Loading…
Reference in a new issue