From d9624819e9ab7032ede3a2e5407d2ec3fb789767 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 11 Apr 2023 16:07:11 +1000 Subject: [PATCH] Add a fully-random review order https://forums.ankiweb.net/t/bug-the-random-option-in-the-review-sort-order-setting-is-not-truly-random/29199 --- proto/anki/deckconfig.proto | 1 + rslib/src/storage/card/mod.rs | 1 + ts/deck-options/DisplayOrder.svelte | 1 + 3 files changed, 3 insertions(+) diff --git a/proto/anki/deckconfig.proto b/proto/anki/deckconfig.proto index f4a796d80..1e571b135 100644 --- a/proto/anki/deckconfig.proto +++ b/proto/anki/deckconfig.proto @@ -73,6 +73,7 @@ message DeckConfig { REVIEW_CARD_ORDER_EASE_ASCENDING = 5; REVIEW_CARD_ORDER_EASE_DESCENDING = 6; REVIEW_CARD_ORDER_RELATIVE_OVERDUENESS = 7; + REVIEW_CARD_ORDER_RANDOM = 8; } enum ReviewMix { REVIEW_MIX_MIX_WITH_REVIEWS = 0; diff --git a/rslib/src/storage/card/mod.rs b/rslib/src/storage/card/mod.rs index 4366b05da..11d42b901 100644 --- a/rslib/src/storage/card/mod.rs +++ b/rslib/src/storage/card/mod.rs @@ -725,6 +725,7 @@ fn review_order_sql(order: ReviewCardOrder, today: u32) -> String { ReviewCardOrder::RelativeOverdueness => { vec![ReviewOrderSubclause::RelativeOverdueness { today }] } + ReviewCardOrder::Random => vec![], }; subclauses.push(ReviewOrderSubclause::Random); diff --git a/ts/deck-options/DisplayOrder.svelte b/ts/deck-options/DisplayOrder.svelte index 58c8f1301..d5f558ed0 100644 --- a/ts/deck-options/DisplayOrder.svelte +++ b/ts/deck-options/DisplayOrder.svelte @@ -50,6 +50,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html tr.deckConfigSortOrderAscendingEase(), tr.deckConfigSortOrderDescendingEase(), tr.deckConfigSortOrderRelativeOverdueness(), + tr.deckConfigSortOrderRandom(), ]; const GatherOrder = DeckConfig.DeckConfig.Config.NewCardGatherPriority;