Skip to content

Commit

Permalink
🎨 Flashcard review interface adds card review times, state and other …
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Mar 5, 2024
1 parent ccd13f6 commit 902f8e9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions card.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ type Card interface {
// SetDue 设置到期时间。
SetDue(time.Time)

// GetLapses 返回闪卡的遗忘次数。
GetLapses() int

// GetReps 返回闪卡的复习次数。
GetReps() int

// GetState 返回闪卡状态。
GetState() State

// GetLastReview 返回闪卡的最后复习时间。
GetLastReview() time.Time

// Clone 返回闪卡的克隆。
Clone() Card

Expand Down
12 changes: 12 additions & 0 deletions fsrs_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,22 @@ func (card *FSRSCard) SetImpl(c interface{}) {
card.C = c.(*fsrs.Card)
}

func (card *FSRSCard) GetLapses() int {
return int(card.C.Lapses)
}

func (card *FSRSCard) GetReps() int {
return int(card.C.Reps)
}

func (card *FSRSCard) GetState() State {
return State(card.C.State)
}

func (card *FSRSCard) GetLastReview() time.Time {
return card.C.LastReview
}

func (card *FSRSCard) Clone() Card {
data, err := gulu.JSON.MarshalJSON(card)
if nil != err {
Expand Down

0 comments on commit 902f8e9

Please sign in to comment.