mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
use a smaller range for random numbers
Using 2**32 is the technically superior solution, since it minimizes the chance of multiple notes sharing a due # (which has implicates for sibiling spacing), but the large numbers are confusing to users.
This commit is contained in:
parent
b4cf7e39b5
commit
f16335ee7f
1 changed files with 2 additions and 2 deletions
|
@ -366,14 +366,14 @@ insert into cards values (?,?,?,?,?,?,0,0,?,0,0,0,0,0,0,0,0,"")""",
|
|||
def _dueForDid(self, did, due):
|
||||
conf = self.decks.confForDid(did)
|
||||
# in order due?
|
||||
if conf['new']['order']:
|
||||
if conf['new']['order'] == NEW_CARDS_DUE:
|
||||
return due
|
||||
else:
|
||||
# random mode; seed with note ts so all cards of this note get the
|
||||
# same random number
|
||||
r = random.Random()
|
||||
r.seed(due)
|
||||
return r.randrange(1, 2**32-1)
|
||||
return r.randrange(1, max(due, 1000))
|
||||
|
||||
# Cards
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in a new issue