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

This commit is contained in:
Daniel 2023-11-16 23:59:46 +08:00
parent 97c33f14d9
commit 342f764840
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -44,10 +44,20 @@ func ResetFlashcards(typ, id, deckID string, blockIDs []string) {
if 0 < len(blockIDs) {
if "" == deckID {
for _, deck := range Decks {
allBlockIDs := deck.GetBlockIDs()
for _, blockID := range blockIDs {
if gulu.Str.Contains(blockID, allBlockIDs) {
deckID = deck.ID
break
}
}
resetFlashcards(deckID, blockIDs)
}
deckID = builtinDeckID
} else {
resetFlashcards(deckID, blockIDs)
}
resetFlashcards(deckID, blockIDs)
return
}