mirror of
https://github.com/ankitects/anki.git
synced 2025-11-14 16:47:12 -05:00
add option to disable burying of reviews
This commit is contained in:
parent
9cb1d19dc2
commit
9baa3e197a
4 changed files with 51 additions and 32 deletions
|
|
@ -71,6 +71,8 @@ defaultConf = {
|
|||
'minSpace': 1, # not currently used
|
||||
'ivlFct': 1,
|
||||
'maxIvl': 36500,
|
||||
# may not be set on old decks
|
||||
'bury': True,
|
||||
},
|
||||
'maxTaken': 60,
|
||||
'timer': 0,
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@
|
|||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
from __future__ import division
|
||||
import time, random, itertools
|
||||
import time
|
||||
import random
|
||||
import itertools
|
||||
from operator import itemgetter
|
||||
from heapq import *
|
||||
|
||||
#from anki.cards import Card
|
||||
from anki.utils import ids2str, intTime, fmtTimeSpan
|
||||
from anki.lang import _
|
||||
|
|
@ -1266,15 +1269,19 @@ update cards set queue=-2,mod=?,usn=? where id in """+ids2str(cids),
|
|||
|
||||
def _burySiblings(self, card):
|
||||
toBury = []
|
||||
conf = self._newConf(card)
|
||||
buryNew = conf.get("bury", True)
|
||||
nconf = self._newConf(card)
|
||||
buryNew = nconf.get("bury", True)
|
||||
rconf = self._revConf(card)
|
||||
buryRev = rconf.get("bury", True)
|
||||
# loop through and remove from queues
|
||||
for cid,queue in self.col.db.execute("""
|
||||
select id, queue from cards where nid=? and id!=?
|
||||
and (queue=0 or (queue=2 and due<=?))""",
|
||||
card.nid, card.id, self.today):
|
||||
if queue == 2:
|
||||
toBury.append(cid)
|
||||
if buryRev:
|
||||
toBury.append(cid)
|
||||
# if bury disabled, we still discard to give same-day spacing
|
||||
try:
|
||||
self._revQueue.remove(cid)
|
||||
except ValueError:
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||
# -*- coding: utf-8 -*-
|
||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
from anki.consts import NEW_CARDS_RANDOM
|
||||
from operator import itemgetter
|
||||
|
||||
from anki.consts import NEW_CARDS_RANDOM
|
||||
from aqt.qt import *
|
||||
import aqt
|
||||
from aqt.utils import showInfo, showWarning, openHelp, getOnlyText, askUser, \
|
||||
tooltip
|
||||
from operator import itemgetter
|
||||
|
||||
class DeckConf(QDialog):
|
||||
def __init__(self, mw, deck):
|
||||
|
|
@ -189,6 +189,7 @@ class DeckConf(QDialog):
|
|||
f.fi1.setValue(c['ivlFct']*100)
|
||||
f.maxIvl.setValue(c['maxIvl'])
|
||||
f.revplim.setText(self.parentLimText('rev'))
|
||||
f.buryRev.setChecked(c.get("bury", True))
|
||||
# lapse
|
||||
c = self.conf['lapse']
|
||||
f.lapSteps.setText(self.listToUser(c['delays']))
|
||||
|
|
@ -270,6 +271,7 @@ class DeckConf(QDialog):
|
|||
c['ease4'] = f.easyBonus.value()/100.0
|
||||
c['ivlFct'] = f.fi1.value()/100.0
|
||||
c['maxIvl'] = f.maxIvl.value()
|
||||
c['bury'] = f.buryRev.isChecked()
|
||||
# lapse
|
||||
c = self.conf['lapse']
|
||||
self.updateList(c, 'delays', f.lapSteps, minSize=0)
|
||||
|
|
|
|||
|
|
@ -271,13 +271,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="revplim">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_33">
|
||||
<property name="text">
|
||||
|
|
@ -292,25 +285,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="fi1">
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
|
|
@ -335,6 +309,39 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="revplim">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="fi1">
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="buryRev">
|
||||
<property name="text">
|
||||
<string>Bury related reviews until the next day</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -616,6 +623,7 @@
|
|||
<tabstop>easyBonus</tabstop>
|
||||
<tabstop>fi1</tabstop>
|
||||
<tabstop>maxIvl</tabstop>
|
||||
<tabstop>buryRev</tabstop>
|
||||
<tabstop>lapSteps</tabstop>
|
||||
<tabstop>lapMult</tabstop>
|
||||
<tabstop>lapMinInt</tabstop>
|
||||
|
|
|
|||
Loading…
Reference in a new issue