From 27225e2ddce24af8c3b7c28c46105f618dd26f26 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 6 Feb 2022 19:34:31 +0100 Subject: Give indications in parenthesis --- src/gui/question.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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) -> bool { - responses.contains(input) + responses + .iter() + .map(|r| r.split("(").collect::>()[0].trim()) + .collect::>() + .contains(&input.as_str()) } fn relative_element(xs: &Vec, x: &T, ri: i32) -> Option { -- cgit v1.2.3