syt0r / Kanji-Dojo

Multiplatform application to memorize Japanese
GNU General Public License v3.0
156 stars 4 forks source link

have end of review session kanji selection screen remember kanjis marked as "Bad" (repeat) #112

Open martinetd opened 3 months ago

martinetd commented 3 months ago

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()
syt0r commented 2 months ago

I've been thinking about this too, but I feel like adding an artificial mistakes for repeat might not be very intuitive and flexible. As an option there might be an additional slider on the practice saving step with how much mistakes to add for each repeat, this way it will keep flexibility, but it still feels weird since characters can have different difficulties and stroke count...

martinetd commented 2 months ago

Yeah, artificial mistakes is definitely not intuitive -- from a user point of view I'm sure I wouldn't understand it myself. It works for me as a workaround, but it's not a solution.

However just changing the mistake count doesn't work for me, I'm actually pressing bad with 0 mistakes from time to time, so there's no way that'd catch up on these. I think we can keep the mistake count as is as a hint/reminder for the user, but base the good/bad selection in recap screen purely on whether "bad" has been pressed, e.g. track it as a different variable. It's a bit intrusive in the code but I think it's the best way to go: it reflect what the user thought about the kanji at the time one saw it during the review itself.