factor → ease_factor

This commit is contained in:
RumovZ 2022-05-11 16:36:13 +02:00
parent b2beab8f40
commit 367c77166b
4 changed files with 7 additions and 7 deletions

View file

@ -77,15 +77,15 @@ class ForeignCard:
Usually a review card, as the default card generation routine will take care Usually a review card, as the default card generation routine will take care
of missing new cards. of missing new cards.
due -- UNIX timestamp due -- UNIX timestamp
interval -- days 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? # TODO: support new and learning cards?
due: int = 0 due: int = 0
interval: int = 1 interval: int = 1
factor: float = STARTING_FACTOR_FRACTION ease_factor: float = STARTING_FACTOR_FRACTION
reps: int = 0 reps: int = 0
lapses: int = 0 lapses: int = 0

View file

@ -143,7 +143,7 @@ class MnemoCard:
def foreign_card(self) -> ForeignCard: def foreign_card(self) -> ForeignCard:
return ForeignCard( return ForeignCard(
factor=self.easiness, ease_factor=self.easiness,
reps=self.reps, reps=self.reps,
lapses=self.lapses, lapses=self.lapses,
interval=self.anki_interval(), interval=self.anki_interval(),

View file

@ -193,7 +193,7 @@ impl ForeignCard {
fn into_native(self, note_id: NoteId, template_idx: u16, deck_id: DeckId, today: u32) -> Card { 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)); let mut card = Card::new(note_id, template_idx, deck_id, self.native_due(today));
card.interval = self.interval; 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.reps = self.reps;
card.lapses = self.lapses; card.lapses = self.lapses;
card card

View file

@ -31,7 +31,7 @@ pub struct ForeignNote {
pub struct ForeignCard { pub struct ForeignCard {
pub due: i32, pub due: i32,
pub interval: u32, pub interval: u32,
pub factor: f32, pub ease_factor: f32,
pub reps: u32, pub reps: u32,
pub lapses: u32, pub lapses: u32,
} }