mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Merge b3af9139a5 into dac26ce671
This commit is contained in:
commit
9cfa8c580d
2 changed files with 16 additions and 5 deletions
|
|
@ -836,9 +836,17 @@ impl fmt::Display for ReviewOrderSubclause {
|
|||
let today = timing.days_elapsed;
|
||||
let next_day_at = timing.next_day_at.0;
|
||||
let now = timing.now.0;
|
||||
temp_string =
|
||||
format!("extract_fsrs_relative_retrievability(data, case when odue !=0 then odue else due end, {today}, ivl, {next_day_at}, {now}) {order}");
|
||||
&temp_string
|
||||
if *order == SqlSortOrder::Ascending {
|
||||
// Use relative retrievability to give higher priority to high DR cards,
|
||||
// while selecting the most overdue ones first
|
||||
temp_string =
|
||||
format!("extract_fsrs_relative_retrievability(data, case when odue !=0 then odue else due end, {today}, ivl, {next_day_at}, {now}) asc");
|
||||
&temp_string
|
||||
} else {
|
||||
temp_string =
|
||||
format!("extract_fsrs_retrievability(data, case when odue !=0 then odue else due end, ivl, {today}, {next_day_at}, {now}) desc");
|
||||
&temp_string
|
||||
}
|
||||
}
|
||||
ReviewOrderSubclause::Added => "nid asc, ord asc",
|
||||
ReviewOrderSubclause::ReverseAdded => "nid desc, ord asc",
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ impl SqliteStorage {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum SqlSortOrder {
|
||||
Ascending,
|
||||
Descending,
|
||||
|
|
@ -677,7 +677,10 @@ mod test {
|
|||
use crate::storage::card::ReviewOrderSubclause;
|
||||
|
||||
#[test]
|
||||
fn missing_memory_state_falls_back_to_sm2() -> Result<()> {
|
||||
// Ascending R uses relative R, which can be approximated using ivl
|
||||
// and elapsed days.
|
||||
// Descending R uses pure R, which can't be approximated.
|
||||
fn missing_memory_state_falls_back_to_sm2_for_asc_r() -> Result<()> {
|
||||
let (mut col, _cids) = v3_test_collection(1)?;
|
||||
col.set_config_bool(BoolKey::Fsrs, true, true)?;
|
||||
col.answer_easy();
|
||||
|
|
|
|||
Loading…
Reference in a new issue