diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index d5004af99..a843da1e2 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -87,8 +87,9 @@ deck-config-leech-action-tooltip = ## Burying section deck-config-bury-title = Burying -deck-config-bury-new-siblings = Bury new siblings until the next day -deck-config-bury-review-siblings = Bury review siblings until the next day +deck-config-bury-new-siblings = Bury new siblings +deck-config-bury-review-siblings = Bury review siblings +deck-config-bury-interday-learning-siblings = Bury interday learning siblings deck-config-bury-tooltip = Whether other cards of the same note (eg reverse cards, adjacent cloze deletions) will be delayed until the next day. diff --git a/proto/anki/deckconfig.proto b/proto/anki/deckconfig.proto index 9aa8feff0..755896f0e 100644 --- a/proto/anki/deckconfig.proto +++ b/proto/anki/deckconfig.proto @@ -88,7 +88,7 @@ message DeckConfig { uint32 reviews_per_day = 10; // not currently used - uint32 new_per_day_minimum = 29; + uint32 new_per_day_minimum = 35; float initial_ease = 11; float easy_multiplier = 12; @@ -121,6 +121,7 @@ message DeckConfig { bool bury_new = 27; bool bury_reviews = 28; + bool bury_interday_learning = 29; bytes other = 255; } diff --git a/rslib/src/deckconfig/mod.rs b/rslib/src/deckconfig/mod.rs index a1ed7543b..f25e5c265 100644 --- a/rslib/src/deckconfig/mod.rs +++ b/rslib/src/deckconfig/mod.rs @@ -75,6 +75,7 @@ impl Default for DeckConfig { skip_question_when_replaying_answer: false, bury_new: false, bury_reviews: false, + bury_interday_learning: false, other: vec![], }, } diff --git a/rslib/src/deckconfig/schema11.rs b/rslib/src/deckconfig/schema11.rs index 38732606e..6ff748c16 100644 --- a/rslib/src/deckconfig/schema11.rs +++ b/rslib/src/deckconfig/schema11.rs @@ -54,6 +54,8 @@ pub struct DeckConfSchema11 { new_sort_order: i32, #[serde(default)] new_gather_priority: i32, + #[serde(default)] + bury_interday_learning: bool, #[serde(flatten)] other: HashMap, @@ -243,6 +245,7 @@ impl Default for DeckConfSchema11 { review_order: 0, new_sort_order: 0, new_gather_priority: 0, + bury_interday_learning: false, } } } @@ -310,6 +313,7 @@ impl From for DeckConfig { skip_question_when_replaying_answer: !c.replayq, bury_new: c.new.bury, bury_reviews: c.rev.bury, + bury_interday_learning: c.bury_interday_learning, other: other_bytes, }, } @@ -397,6 +401,7 @@ impl From for DeckConfSchema11 { review_order: i.review_order, new_sort_order: i.new_card_sort_order, new_gather_priority: i.new_card_gather_priority, + bury_interday_learning: i.bury_interday_learning, } } } @@ -416,6 +421,7 @@ fn clear_other_duplicates(top_other: &mut HashMap) { "reviewOrder", "newSortOrder", "newGatherPriority", + "buryInterdayLearning", ] { top_other.remove(*key); } diff --git a/rslib/src/scheduler/answering/mod.rs b/rslib/src/scheduler/answering/mod.rs index 1bce3ffef..4baf57b67 100644 --- a/rslib/src/scheduler/answering/mod.rs +++ b/rslib/src/scheduler/answering/mod.rs @@ -9,7 +9,6 @@ mod review; mod revlog; use rand::{prelude::*, rngs::StdRng}; - use revlog::RevlogEntryPartial; use super::{ @@ -281,6 +280,7 @@ impl Collection { card.note_id, config.inner.bury_new, config.inner.bury_reviews, + config.inner.bury_interday_learning, )?; } diff --git a/rslib/src/scheduler/bury_and_suspend.rs b/rslib/src/scheduler/bury_and_suspend.rs index 854da86f5..81114b90d 100644 --- a/rslib/src/scheduler/bury_and_suspend.rs +++ b/rslib/src/scheduler/bury_and_suspend.rs @@ -147,9 +147,15 @@ impl Collection { nid: NoteId, include_new: bool, include_reviews: bool, + include_day_learn: bool, ) -> Result { - self.storage - .search_siblings_for_bury(cid, nid, include_new, include_reviews)?; + self.storage.search_siblings_for_bury( + cid, + nid, + include_new, + include_reviews, + include_day_learn, + )?; self.bury_or_suspend_searched_cards(BuryOrSuspendMode::BurySched) } } diff --git a/rslib/src/scheduler/queue/builder/burying.rs b/rslib/src/scheduler/queue/builder/burying.rs index 1d37724db..2a8169d47 100644 --- a/rslib/src/scheduler/queue/builder/burying.rs +++ b/rslib/src/scheduler/queue/builder/burying.rs @@ -46,6 +46,7 @@ impl Context { .map(|config| BuryMode { bury_new: config.inner.bury_new, bury_reviews: config.inner.bury_reviews, + bury_interday_learning: config.inner.bury_interday_learning, }) .unwrap_or_default() } @@ -68,6 +69,7 @@ impl QueueBuilder { previous_mode = Some(*entry); entry.bury_new |= new_mode.bury_new; entry.bury_reviews |= new_mode.bury_reviews; + entry.bury_interday_learning |= new_mode.bury_interday_learning; }) .or_insert(new_mode); diff --git a/rslib/src/scheduler/queue/builder/gathering.rs b/rslib/src/scheduler/queue/builder/gathering.rs index 30d97eccf..6a26798a2 100644 --- a/rslib/src/scheduler/queue/builder/gathering.rs +++ b/rslib/src/scheduler/queue/builder/gathering.rs @@ -122,7 +122,10 @@ impl QueueBuilder { fn add_due_card(&mut self, card: DueCard) -> bool { let bury_this_card = self .get_and_update_bury_mode_for_note(card.into()) - .map(|mode| mode.bury_reviews) + .map(|mode| match card.kind { + DueCardKind::Review => mode.bury_reviews, + DueCardKind::Learning => mode.bury_interday_learning, + }) .unwrap_or_default(); if bury_this_card { false diff --git a/rslib/src/scheduler/queue/builder/mod.rs b/rslib/src/scheduler/queue/builder/mod.rs index e21d4dcc0..a60c95d57 100644 --- a/rslib/src/scheduler/queue/builder/mod.rs +++ b/rslib/src/scheduler/queue/builder/mod.rs @@ -89,6 +89,7 @@ impl From for LearningQueueEntry { pub(super) struct BuryMode { bury_new: bool, bury_reviews: bool, + bury_interday_learning: bool, } #[derive(Default, Clone, Debug)] diff --git a/rslib/src/storage/card/mod.rs b/rslib/src/storage/card/mod.rs index 6710d518a..1910fd39e 100644 --- a/rslib/src/storage/card/mod.rs +++ b/rslib/src/storage/card/mod.rs @@ -417,6 +417,7 @@ impl super::SqliteStorage { nid: NoteId, include_new: bool, include_reviews: bool, + include_day_learn: bool, ) -> Result<()> { self.setup_searched_cards_table()?; let params = named_params! { @@ -424,6 +425,7 @@ impl super::SqliteStorage { ":note_id": nid, ":include_new": include_new, ":include_reviews": include_reviews, + ":include_day_learn": include_day_learn, ":new_queue": CardQueue::New as i8, ":review_queue": CardQueue::Review as i8, ":daylearn_queue": CardQueue::DayLearn as i8, diff --git a/rslib/src/storage/card/siblings_for_bury.sql b/rslib/src/storage/card/siblings_for_bury.sql index 7a96bbc04..7731b45ec 100644 --- a/rslib/src/storage/card/siblings_for_bury.sql +++ b/rslib/src/storage/card/siblings_for_bury.sql @@ -10,6 +10,10 @@ WHERE id != :card_id ) OR ( :include_reviews - AND queue IN (:review_queue, :daylearn_queue) + AND queue = :review_queue + ) + OR ( + :include_day_learn + AND queue = :daylearn_queue ) ); \ No newline at end of file diff --git a/ts/deck-options/BuryOptions.svelte b/ts/deck-options/BuryOptions.svelte index 1785b5d16..cca15294c 100644 --- a/ts/deck-options/BuryOptions.svelte +++ b/ts/deck-options/BuryOptions.svelte @@ -38,5 +38,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html {tr.deckConfigBuryReviewSiblings()} + + + + {tr.deckConfigBuryInterdayLearningSiblings()} + +