Kanji-Dojo
Kanji-Dojo copied to clipboard
have end of review session kanji selection screen remember kanjis marked as "Bad" (repeat)
When reviewing (write practice) I sometimes do small mistakes that the recognition is too nice about and accepts, or just make a single mistake but still click "bad" to reschedule a review.
However, at the end screen only kanjis with more than 3 mistakes are selected for re-scheduling, regardless of whether bad was pressed or not. That means that I often need to go through the list and try to remember where I pressed bad or not.
I've made a local workaround that just adds 10 mistakes whenever bad is pressed (diff below), but that's not really acceptable for submission -- I guess we could add a separate "repeatMap" and flag kanjis as bad in PracticeSavingState regardless of mistake count, but that's a bit of code shuffling to get it all the way there so I've been lazy at this point.
diff --git a/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/writing_practice/WritingPracticeViewModel.kt b/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/writing_practice/WritingPracticeViewModel.kt
index ab1573aa9e94..21cd0625b06b 100644
--- a/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/writing_practice/WritingPracticeViewModel.kt
+++ b/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/writing_practice/WritingPracticeViewModel.kt
@@ -188,7 +188,7 @@ class WritingPracticeViewModel(
override fun loadNextCharacter(userAction: ReviewUserAction) {
val (character, mistakes) = reviewDataState.value
.run { characterData.character to currentCharacterMistakes.value }
- mistakesMap[character] = mistakesMap.getOrDefault(character, 0) + mistakes
+ mistakesMap[character] = mistakesMap.getOrDefault(character, 0) + mistakes + (if (userAction == Next) 0 else 10)
val action = when (userAction) {
Next -> ReviewAction.Next()