Fix/Relearning cards' Intervals don't update after changing Desired Retention (#3236)
* Fix/Relearning cards' Intervals don't update after changing Desired Retention * cargo clippy --fix
This commit is contained in:
parent
9dc3b10fe9
commit
79917bbd2d
@ -52,6 +52,14 @@ impl RelearnState {
|
||||
},
|
||||
}
|
||||
.into()
|
||||
} else if let Some(states) = &ctx.fsrs_next_states {
|
||||
let (minimum, maximum) = ctx.min_and_max_review_intervals(1);
|
||||
let interval = states.again.interval;
|
||||
ReviewState {
|
||||
scheduled_days: ctx.with_review_fuzz(interval as f32, minimum, maximum),
|
||||
..self.review
|
||||
}
|
||||
.into()
|
||||
} else {
|
||||
self.review.into()
|
||||
}
|
||||
@ -76,6 +84,14 @@ impl RelearnState {
|
||||
},
|
||||
}
|
||||
.into()
|
||||
} else if let Some(states) = &ctx.fsrs_next_states {
|
||||
let (minimum, maximum) = ctx.min_and_max_review_intervals(1);
|
||||
let interval = states.hard.interval;
|
||||
ReviewState {
|
||||
scheduled_days: ctx.with_review_fuzz(interval as f32, minimum, maximum),
|
||||
..self.review
|
||||
}
|
||||
.into()
|
||||
} else {
|
||||
self.review.into()
|
||||
}
|
||||
@ -103,14 +119,29 @@ impl RelearnState {
|
||||
},
|
||||
}
|
||||
.into()
|
||||
} else if let Some(states) = &ctx.fsrs_next_states {
|
||||
let (minimum, maximum) = ctx.min_and_max_review_intervals(1);
|
||||
let interval = states.good.interval;
|
||||
ReviewState {
|
||||
scheduled_days: ctx.with_review_fuzz(interval as f32, minimum, maximum),
|
||||
..self.review
|
||||
}
|
||||
.into()
|
||||
} else {
|
||||
self.review.into()
|
||||
}
|
||||
}
|
||||
|
||||
fn answer_easy(self, ctx: &StateContext) -> ReviewState {
|
||||
let scheduled_days = if let Some(states) = &ctx.fsrs_next_states {
|
||||
let (minimum, maximum) = ctx.min_and_max_review_intervals(1);
|
||||
let interval = states.easy.interval;
|
||||
ctx.with_review_fuzz(interval as f32, minimum, maximum)
|
||||
} else {
|
||||
self.review.scheduled_days + 1
|
||||
};
|
||||
ReviewState {
|
||||
scheduled_days: self.review.scheduled_days + 1,
|
||||
scheduled_days,
|
||||
elapsed_days: 0,
|
||||
memory_state: ctx.fsrs_next_states.as_ref().map(|s| s.easy.memory.into()),
|
||||
..self.review
|
||||
|
Loading…
Reference in New Issue
Block a user