From f16335ee7f20f4b1c1ea45bd92eb3ff0684fa20a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 21 Apr 2012 08:56:56 +0900 Subject: [PATCH] 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. --- anki/collection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anki/collection.py b/anki/collection.py index 7f749739d..d9b23c7d2 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -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 ##########################################################################