cardHasTag(), userTime(), remove firstAnswered from cardlist

This commit is contained in:
Damien Elmes 2011-02-21 09:36:02 +09:00
parent d02a26309f
commit 9b14bd6ab0
3 changed files with 8 additions and 6 deletions

View file

@ -22,6 +22,8 @@ from anki.db import *
from anki.stats import CardStats
from anki.hooks import runHook, addHook, removeHook
# - first answered needs updating
CARD_ID = 0
CARD_QUESTION = 1
CARD_ANSWER = 2
@ -190,10 +192,10 @@ where cards.factId = facts.id """
def updateCard(self, index):
try:
self.cards[index.row()] = self.deck.db.first("""
select id, question, answer, combinedDue, reps, factId, created, modified,
interval, factor, noCount, type, (select tags from facts where
select id, question, answer, due, reps, factId, created, modified,
interval, factor, lapses, type, (select tags from facts where
facts.id = cards.factId), (select created from facts where
facts.id = cards.factId), firstAnswered from cards where id = :id""",
facts.id = cards.factId) from cards where id = :id""",
id=self.cards[index.row()][0])
self.emit(SIGNAL("layoutChanged()"))
except:

View file

@ -1889,7 +1889,7 @@ learnt today")
##########################################################################
def onMark(self, toggled):
if self.currentCard.hasTag("Marked"):
if self.deck.cardHasTag(self.currentCard, "Marked"):
self.currentCard.fact.tags = canonifyTags(deleteTags(
"Marked", self.currentCard.fact.tags))
else:
@ -2558,7 +2558,7 @@ This deck already exists on your computer. Overwrite the local copy?"""),
def updateMarkAction(self):
self.mainWin.actionMarkCard.blockSignals(True)
if self.currentCard.hasTag("Marked"):
if self.deck.cardHasTag(self.currentCard, "Marked"):
self.mainWin.actionMarkCard.setChecked(True)
else:
self.mainWin.actionMarkCard.setChecked(False)

View file

@ -239,7 +239,7 @@ You should aim to answer each question within<br>
return
if not self.main.config['showCardTimer']:
return
t = self.main.currentCard.thinkingTime()
t = self.main.currentCard.userTime()
self.setTimer('%02d:%02d' % (t/60, t%60))
return
self.setTimer("00:00")