mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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];
|
let mut arr = [0.0; 5];
|
||||||
for (review_kind, group) in group_sec_by_review_kind.iter().enumerate() {
|
for (review_kind, group) in group_sec_by_review_kind.iter().enumerate() {
|
||||||
|
let average_secs =
|
||||||
if group.is_empty() && review_kind == RevlogReviewKind::Relearning as usize {
|
if group.is_empty() && review_kind == RevlogReviewKind::Relearning as usize {
|
||||||
return Err(AnkiError::FsrsInsufficientData);
|
30.0
|
||||||
}
|
} else {
|
||||||
let average_secs = group.iter().sum::<u32>() as f64 / group.len() as f64 / 1000.0;
|
group.iter().sum::<u32>() as f64 / group.len() as f64 / 1000.0
|
||||||
|
};
|
||||||
arr[review_kind] = average_secs
|
arr[review_kind] = average_secs
|
||||||
}
|
}
|
||||||
arr
|
arr
|
||||||
|
|
Loading…
Reference in a new issue