mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 When the current spaced repetition is completed, supports choose whether to continue https://github.com/siyuan-note/siyuan/issues/7943
This commit is contained in:
parent
71369fd71d
commit
fc8a4c8466
2 changed files with 49 additions and 23 deletions
|
|
@ -135,14 +135,17 @@ func getNotebookRiffDueCards(c *gin.Context) {
|
|||
|
||||
notebookID := arg["notebook"].(string)
|
||||
reviewedCardIDs := getReviewedCards(arg)
|
||||
cards, err := model.GetNotebookDueFlashcards(notebookID, reviewedCardIDs)
|
||||
cards, unreviewedCount, err := model.GetNotebookDueFlashcards(notebookID, reviewedCardIDs)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = cards
|
||||
ret.Data = map[string]interface{}{
|
||||
"cards": cards,
|
||||
"unreviewedCount": unreviewedCount,
|
||||
}
|
||||
}
|
||||
|
||||
func getTreeRiffDueCards(c *gin.Context) {
|
||||
|
|
@ -156,14 +159,17 @@ func getTreeRiffDueCards(c *gin.Context) {
|
|||
|
||||
rootID := arg["rootID"].(string)
|
||||
reviewedCardIDs := getReviewedCards(arg)
|
||||
cards, err := model.GetTreeDueFlashcards(rootID, reviewedCardIDs)
|
||||
cards, unreviewedCount, err := model.GetTreeDueFlashcards(rootID, reviewedCardIDs)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = cards
|
||||
ret.Data = map[string]interface{}{
|
||||
"cards": cards,
|
||||
"unreviewedCount": unreviewedCount,
|
||||
}
|
||||
}
|
||||
|
||||
func getRiffDueCards(c *gin.Context) {
|
||||
|
|
@ -177,14 +183,17 @@ func getRiffDueCards(c *gin.Context) {
|
|||
|
||||
deckID := arg["deckID"].(string)
|
||||
reviewedCardIDs := getReviewedCards(arg)
|
||||
cards, err := model.GetDueFlashcards(deckID, reviewedCardIDs)
|
||||
cards, unreviewedCount, err := model.GetDueFlashcards(deckID, reviewedCardIDs)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = cards
|
||||
ret.Data = map[string]interface{}{
|
||||
"cards": cards,
|
||||
"unreviewedCount": unreviewedCount,
|
||||
}
|
||||
}
|
||||
|
||||
func getReviewedCards(arg map[string]interface{}) (ret []string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue