syt0r / Kanji-Dojo

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

reschedule repeat kanjis later #113

Open martinetd opened 3 months ago

martinetd commented 3 months ago

Flagging a kanji as bad currently always reschedules it in position 2 (after 2 other kanjis)

This feels way too soon for me; I'm currently experimenting rescheduling it at random between 7 and 15 kanjis later:

diff --git a/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/practice_common/CharacterReviewManager.kt b/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/practice_common/CharacterReviewManager.kt
index d07a93690fc5..796095697e5f 100644
--- a/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/practice_common/CharacterReviewManager.kt
+++ b/core/src/commonMain/kotlin/ua/syt0r/kanji/presentation/screen/main/screen/practice_common/CharacterReviewManager.kt
@@ -8,6 +8,7 @@ import kotlinx.datetime.Instant
 import ua.syt0r.kanji.core.time.TimeUtils
 import java.util.LinkedList
 import kotlin.math.min
+import kotlin.random.Random
 import kotlin.time.Duration

 interface CharacterReviewManager<HistoryStatus, CharacterDetails, CharacterReviewSummary> {
@@ -57,10 +58,6 @@ abstract class BaseCharacterReviewManager<HistoryStatus, CharacterDetails, Chara
     private val onCompletedCallback: () -> Unit
 ) : CharacterReviewManager<HistoryStatus, CharacterDetails, CharacterReviewSummary> {

-    companion object {
-        private const val RepeatIndexShift = 2
-    }
-
     private val queue = LinkedList(reviewItems)
     private val completedItems =
         mutableListOf<Pair<String, SummaryCharacterData<CharacterReviewSummary>>>()
@@ -130,7 +127,8 @@ abstract class BaseCharacterReviewManager<HistoryStatus, CharacterDetails, Chara
         val updatedCharacterData = queue.poll().run {
             copy(history = history.plus(status))
         }
-        val insertPosition = min(RepeatIndexShift, queue.size)
+        val randomPos = Random.nextInt(7, 15)
+        val insertPosition = min(randomPos, queue.size)
         queue.add(insertPosition, updatedCharacterData)

         addCharacterReviewDuration(updatedCharacterData.character)

However I suppose you had a reason to make it only 2? Perhaps this should be made into an option? That's probably not too much work to make it an option so I'll be happy to scratch this itch myself if you're ok with it as a first contrib :)

EDIT: ah, likewise learn new mode probably shouldn't reschedule it back to back, but in that case something like +2 sounds appropriate. I'm not using learn new much as I'm still reviewing kanjis I ought to know at this point, so not as much a problem for me here -- I assume that button maps to StudyNext in code I didn't check...

syt0r commented 3 months ago

Yeah, I think it might get confusing for users if there will be a dynamic repeat delay. As an option I can think of it can be improved by adding more options, like: relearn, repeat soon, repeat later, complete, similar to anki. Although idk how it will look

martinetd commented 3 months ago

Hm, are we thinking of the same "schedule"?

I can think of two separate things for this term:

As far as I understand the anki buttons grading hard/normal/easy only ever affect the former (make the card re-appear sooner or later), and the bad button will also reschedule a card for immediate review during the same session as well, so I'm a bit confused with your answer.

This issue was about the kanji reappearing immediately within the same review, I don't think that warrants being configurable, nor do I find it confusing to be a bit random (the whole point is to not be able to remember through non-kanji-relevant information like order of appearance), but perhaps we're not expecting the same thing here. If we want to do something "nice" here I'd say the position in the queue should be proportional to how well known the kanji is supposed to be - if it's a kanji you've never seen before and are learning then it should be shown again fast, but if it's a mistake on something you've already learned there should be a long enough delay to make the longer term memory work. Since that sounded a bit difficult I suggested just differentiating the learn new vs. review, but perhaps we can actually do better.

For longer term rescheduling I agree there might also be room for something more anki-like, but I honestly don't see how to make it work UX-wise unless we no longer offer a recap screen and commit it immediately during review... I'm not against it, but perhaps another issue :)

syt0r commented 3 months ago

Right now these buttons don't have any impact on schedule time for the next review, the time for the next review is controlled on the summary screen where you can choose if you want to repeat character tomorrow, so right now buttons only control when to repeat character within current practice session, there's no grading like in anki

Schedule system for sure needs to be improved, but I don't have enough knowledge to make it better right away from my head, this needs to be investigated. I might open another issue to make it possible to adjust scheduling and think about adding some reports to learn efficiency. Right now it's not pretty good because writing and reading reviews are using the same scheduling logic but the complexity differs significantly

What you are telling makes sense, but it's pretty unclear how to do it right :sweat_smile:

martinetd commented 1 month ago

Self feedback here: I'll probably try to add a third button "retry immediately" to redraw immediately after seeing the correct form.

If I had been doing reviews seriously I don't think I'd have cared as much but I'll shamefully admit to slacking lately (biking to work now snow melted -> no train to review on :grin:), so after pulling serious blanks I'd have appreciated checking I saw the correct form immediately, then once again with +7-15 as my current patch.

That way small mistakes would just be redraw once "later" (after having wiped short memory by drawing a few other kanjis), but I could reinforce memory a bit quickly on bigger mistakes; that makes the UI more complex so it's probably not a good idea to just have three buttons on the screen for new people though...

(I think with the current "bad" being something like +2 it doesn't matter as much, so nothing to do immediately)