mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
factor → ease_factor
This commit is contained in:
parent
b2beab8f40
commit
367c77166b
4 changed files with 7 additions and 7 deletions
|
@ -79,13 +79,13 @@ class ForeignCard:
|
|||
|
||||
due -- UNIX timestamp
|
||||
interval -- days
|
||||
factor -- decimal fraction (2.5 corresponds to default ease)
|
||||
ease_factor -- decimal fraction (2.5 corresponds to default ease)
|
||||
"""
|
||||
|
||||
# TODO: support new and learning cards?
|
||||
due: int = 0
|
||||
interval: int = 1
|
||||
factor: float = STARTING_FACTOR_FRACTION
|
||||
ease_factor: float = STARTING_FACTOR_FRACTION
|
||||
reps: int = 0
|
||||
lapses: int = 0
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ class MnemoCard:
|
|||
|
||||
def foreign_card(self) -> ForeignCard:
|
||||
return ForeignCard(
|
||||
factor=self.easiness,
|
||||
ease_factor=self.easiness,
|
||||
reps=self.reps,
|
||||
lapses=self.lapses,
|
||||
interval=self.anki_interval(),
|
||||
|
|
|
@ -193,7 +193,7 @@ impl ForeignCard {
|
|||
fn into_native(self, note_id: NoteId, template_idx: u16, deck_id: DeckId, today: u32) -> Card {
|
||||
let mut card = Card::new(note_id, template_idx, deck_id, self.native_due(today));
|
||||
card.interval = self.interval;
|
||||
card.ease_factor = (self.factor * 1000.).round() as u16;
|
||||
card.ease_factor = (self.ease_factor * 1000.).round() as u16;
|
||||
card.reps = self.reps;
|
||||
card.lapses = self.lapses;
|
||||
card
|
||||
|
|
|
@ -31,7 +31,7 @@ pub struct ForeignNote {
|
|||
pub struct ForeignCard {
|
||||
pub due: i32,
|
||||
pub interval: u32,
|
||||
pub factor: f32,
|
||||
pub ease_factor: f32,
|
||||
pub reps: u32,
|
||||
pub lapses: u32,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue