From cf731c6bad5b0629d613f7ab13546a71105dab67 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 31 Jul 2021 14:57:04 +1000 Subject: [PATCH] fix v3 not honoring initial ease factor Closes #1317 --- rslib/src/scheduler/answering/mod.rs | 1 + rslib/src/scheduler/states/learning.rs | 4 ++++ rslib/src/scheduler/states/mod.rs | 1 + 3 files changed, 6 insertions(+) diff --git a/rslib/src/scheduler/answering/mod.rs b/rslib/src/scheduler/answering/mod.rs index 3fe117f3b..8222169bc 100644 --- a/rslib/src/scheduler/answering/mod.rs +++ b/rslib/src/scheduler/answering/mod.rs @@ -65,6 +65,7 @@ impl CardStateUpdater { steps: self.learn_steps(), graduating_interval_good: self.config.inner.graduating_interval_good, graduating_interval_easy: self.config.inner.graduating_interval_easy, + initial_ease_factor: self.config.inner.initial_ease, hard_multiplier: self.config.inner.hard_multiplier, easy_multiplier: self.config.inner.easy_multiplier, interval_multiplier: self.config.inner.interval_multiplier, diff --git a/rslib/src/scheduler/states/learning.rs b/rslib/src/scheduler/states/learning.rs index 82c9f9605..57223bc36 100644 --- a/rslib/src/scheduler/states/learning.rs +++ b/rslib/src/scheduler/states/learning.rs @@ -44,8 +44,10 @@ impl LearnState { } .into() } else { + // steps modified while card in learning ReviewState { scheduled_days: ctx.fuzzed_graduating_interval_good(), + ease_factor: ctx.initial_ease_factor, ..Default::default() } .into() @@ -62,6 +64,7 @@ impl LearnState { } else { ReviewState { scheduled_days: ctx.fuzzed_graduating_interval_good(), + ease_factor: ctx.initial_ease_factor, ..Default::default() } .into() @@ -71,6 +74,7 @@ impl LearnState { fn answer_easy(self, ctx: &StateContext) -> ReviewState { ReviewState { scheduled_days: ctx.fuzzed_graduating_interval_easy(), + ease_factor: ctx.initial_ease_factor, ..Default::default() } } diff --git a/rslib/src/scheduler/states/mod.rs b/rslib/src/scheduler/states/mod.rs index 45f12fb16..15b97bcd3 100644 --- a/rslib/src/scheduler/states/mod.rs +++ b/rslib/src/scheduler/states/mod.rs @@ -75,6 +75,7 @@ pub(crate) struct StateContext<'a> { pub steps: LearningSteps<'a>, pub graduating_interval_good: u32, pub graduating_interval_easy: u32, + pub initial_ease_factor: f32, // reviewing pub hard_multiplier: f32,