aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2022-02-06 19:34:31 +0100
committerJoris2022-02-06 19:34:31 +0100
commit27225e2ddce24af8c3b7c28c46105f618dd26f26 (patch)
tree539ffe6a912efb12941a2082141354fbfe1c0c82 /src
parent20cfe717065fa53953e9799036a9972880fec801 (diff)
Give indications in parenthesis
Diffstat (limited to 'src')
-rw-r--r--src/gui/question.rs6
1 files changed, 5 insertions, 1 deletions
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> {