aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/gui/question.rs6
2 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index 116c6c5..fc078de 100644
--- a/README.md
+++ b/README.md
@@ -13,11 +13,11 @@ Cards are created from a plain text `./deck` file:
- good moorning : bonjour
- alternative 1 | alternative 2 : choix 1 | choix 2
+- cat (indication) : chat
```
# TODO
-- Indications in parenthesis
- Look at last modification of the deck, and omit db sync if last sync was after
- Fix crashes on zoom / changing size
diff --git a/src/gui/question.rs b/src/gui/question.rs
index a22b977..64589d9 100644
--- a/src/gui/question.rs
+++ b/src/gui/question.rs
@@ -185,7 +185,11 @@ fn center_vertically(chunk: Rect, text: &String) -> String {
}
fn is_correct(input: &String, responses: &Vec<String>) -> bool {
- responses.contains(input)
+ responses
+ .iter()
+ .map(|r| r.split("(").collect::<Vec<&str>>()[0].trim())
+ .collect::<Vec<&str>>()
+ .contains(&input.as_str())
}
fn relative_element<T: Clone + PartialEq>(xs: &Vec<T>, x: &T, ri: i32) -> Option<T> {