mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 12:03:56 -05:00
Fix: Used wrong ord
This commit is contained in:
parent
666e22ed42
commit
65954cb2a5
1 changed files with 4 additions and 5 deletions
|
|
@ -454,12 +454,11 @@ impl crate::services::SchedulerService for Collection {
|
||||||
let notetype = self
|
let notetype = self
|
||||||
.get_notetype(note.notetype_id.into())?
|
.get_notetype(note.notetype_id.into())?
|
||||||
.or_not_found(note.notetype_id)?;
|
.or_not_found(note.notetype_id)?;
|
||||||
let ord = notetype.get_field_ord(&field.1).or_not_found(field.1)?;
|
let field_ord = notetype.get_field_ord(&field.1).or_not_found(field.1)?;
|
||||||
let mut correct = note.fields[ord].clone();
|
let mut correct = note.fields[field_ord].clone();
|
||||||
if field.0.contains("cloze") {
|
if field.0.contains("cloze") {
|
||||||
correct =
|
let card_ord = queue.cards[0].card.template_idx;
|
||||||
extract_cloze_for_typing(&correct, (ord + 1).try_into().unwrap_or(0))
|
correct = extract_cloze_for_typing(&correct, card_ord + 1).to_string()
|
||||||
.to_string()
|
|
||||||
}
|
}
|
||||||
Ok((field.0, correct))
|
Ok((field.0, correct))
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue