mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Apply fuzz to SM2 lapse interval and respect max ivl (#3275)
* Apply fuzz to SM2 lapse interval and respect max ivl Imo, there is no reason for not applying fuzz to SM2 lapse intervals * Update review.rs * Format * Update review.rs * Update review.rs * Update review.rs * Update review.rs
This commit is contained in:
parent
88b506413f
commit
6ec22e5118
1 changed files with 8 additions and 3 deletions
|
@ -77,11 +77,16 @@ impl ReviewState {
|
|||
ctx: &StateContext,
|
||||
) -> (u32, Option<FsrsMemoryState>) {
|
||||
if let Some(states) = &ctx.fsrs_next_states {
|
||||
// In FSRS, fuzz is applied when the card leaves the relearning
|
||||
// stage
|
||||
(states.again.interval, Some(states.again.memory.into()))
|
||||
} else {
|
||||
let interval = (((self.scheduled_days as f32) * ctx.lapse_multiplier) as u32)
|
||||
.max(ctx.minimum_lapse_interval)
|
||||
.max(1);
|
||||
let (minimum, maximum) = ctx.min_and_max_review_intervals(ctx.minimum_lapse_interval);
|
||||
let interval = ctx.with_review_fuzz(
|
||||
(self.scheduled_days as f32) * ctx.lapse_multiplier,
|
||||
minimum,
|
||||
maximum,
|
||||
);
|
||||
(interval, None)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue