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

Danielbbeb6282d665
diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.go
index fc88f26bc2..21b377a6d6 100644
--- a/kernel/model/flashcard.go
+++ b/kernel/model/flashcard.go
@@ -52,7 +52,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
case "notebook":
for i := 1; ; i++ {
pagedBlocks, _, _ := GetNotebookFlashcards(id, i)
- if 1 > len(blocks) {
+ if 1 > len(pagedBlocks) {
break
}
blocks = append(blocks, pagedBlocks...)
@@ -63,7 +63,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
case "tree":
for i := 1; ; i++ {
pagedBlocks, _, _ := GetTreeFlashcards(id, i)
- if 1 > len(blocks) {
+ if 1 > len(pagedBlocks) {
break
}
blocks = append(blocks, pagedBlocks...)
@@ -74,7 +74,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
case "deck":
for i := 1; ; i++ {
pagedBlocks, _, _ := GetDeckFlashcards(id, i)
- if 1 > len(blocks) {
+ if 1 > len(pagedBlocks) {
break
}
blocks = append(blocks, pagedBlocks...)