mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -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
|
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
|
||||||
|
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue