aboutsummaryrefslogtreecommitdiff
path: root/src/gui/question.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/question.rs')
-rw-r--r--src/gui/question.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/question.rs b/src/gui/question.rs
index 12ffa6f..512ca49 100644
--- a/src/gui/question.rs
+++ b/src/gui/question.rs
@@ -129,9 +129,14 @@ pub fn ask<B: Backend>(terminal: &mut Terminal<B>, title: &str, card: &Card) ->
match state.answer {
Answer::Write => match key.code {
KeyCode::Enter => {
- let difficulty = match check_response(&state.input, &card.responses) {
- CheckResponse::Correct { phonetics: _ } => Difficulty::Good,
- CheckResponse::Incorrect => Difficulty::Again,
+ let difficulty = if state.input.is_empty() {
+ // Encourage solving without typing by defaulting to good answer
+ Difficulty::Good
+ } else {
+ match check_response(&state.input, &card.responses) {
+ CheckResponse::Correct { phonetics: _ } => Difficulty::Good,
+ CheckResponse::Incorrect => Difficulty::Again,
+ }
};
state.answer = Answer::Difficulty { difficulty }
}