mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
When the user has no relearning steps, synthesize the value
This commit is contained in:
parent
41bddfc6cb
commit
3636c7c90e
1 changed files with 6 additions and 4 deletions
|
@ -174,10 +174,12 @@ impl Collection {
|
|||
}
|
||||
let mut arr = [0.0; 5];
|
||||
for (review_kind, group) in group_sec_by_review_kind.iter().enumerate() {
|
||||
if group.is_empty() && review_kind == RevlogReviewKind::Relearning as usize {
|
||||
return Err(AnkiError::FsrsInsufficientData);
|
||||
}
|
||||
let average_secs = group.iter().sum::<u32>() as f64 / group.len() as f64 / 1000.0;
|
||||
let average_secs =
|
||||
if group.is_empty() && review_kind == RevlogReviewKind::Relearning as usize {
|
||||
30.0
|
||||
} else {
|
||||
group.iter().sum::<u32>() as f64 / group.len() as f64 / 1000.0
|
||||
};
|
||||
arr[review_kind] = average_secs
|
||||
}
|
||||
arr
|
||||
|
|
Loading…
Reference in a new issue