浏览代码

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

Daniel 1 年之前
父节点
当前提交
bbeb6282d6
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      kernel/model/flashcard.go

+ 3 - 3
kernel/model/flashcard.go

@@ -52,7 +52,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
 	case "notebook":
 	case "notebook":
 		for i := 1; ; i++ {
 		for i := 1; ; i++ {
 			pagedBlocks, _, _ := GetNotebookFlashcards(id, i)
 			pagedBlocks, _, _ := GetNotebookFlashcards(id, i)
-			if 1 > len(blocks) {
+			if 1 > len(pagedBlocks) {
 				break
 				break
 			}
 			}
 			blocks = append(blocks, pagedBlocks...)
 			blocks = append(blocks, pagedBlocks...)
@@ -63,7 +63,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
 	case "tree":
 	case "tree":
 		for i := 1; ; i++ {
 		for i := 1; ; i++ {
 			pagedBlocks, _, _ := GetTreeFlashcards(id, i)
 			pagedBlocks, _, _ := GetTreeFlashcards(id, i)
-			if 1 > len(blocks) {
+			if 1 > len(pagedBlocks) {
 				break
 				break
 			}
 			}
 			blocks = append(blocks, pagedBlocks...)
 			blocks = append(blocks, pagedBlocks...)
@@ -74,7 +74,7 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
 	case "deck":
 	case "deck":
 		for i := 1; ; i++ {
 		for i := 1; ; i++ {
 			pagedBlocks, _, _ := GetDeckFlashcards(id, i)
 			pagedBlocks, _, _ := GetDeckFlashcards(id, i)
-			if 1 > len(blocks) {
+			if 1 > len(pagedBlocks) {
 				break
 				break
 			}
 			}
 			blocks = append(blocks, pagedBlocks...)
 			blocks = append(blocks, pagedBlocks...)