Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Support resetting the learning progress of flashcards https://github.com/siyuan-note/siyuan/issues/9564

Danield81dfc503c37
diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.go
index 9cc7a7f608..7ec61925d1 100644
--- a/kernel/model/flashcard.go
+++ b/kernel/model/flashcard.go
@@ -44,6 +44,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
if 0 < len(blockIDs) {
if "" == deckID {
+ // 从全局管理进入时不会指定卡包 ID,这时需要遍历所有卡包
for _, deck := range Decks {
allBlockIDs := deck.GetBlockIDs()
for _, blockID := range blockIDs {
@@ -53,6 +54,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
}
}
if "" == deckID {
+ logging.LogWarnf("deck not found for blocks [%s]", strings.Join(blockIDs, ","))
continue
}
resetFlashcards(deckID, blockIDs)