From f838d3d10cb71ec32a007ae078b4dbe22491a1a8 Mon Sep 17 00:00:00 2001 From: Bikatr7 Date: Tue, 30 Apr 2024 11:00:15 -0600 Subject: [PATCH] corrected an incorrect prompt and allowed user to exit via q on the improper answer prompt --- modules/score_rater.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/score_rater.py b/modules/score_rater.py index 97dcaf2..526f8d4 100644 --- a/modules/score_rater.py +++ b/modules/score_rater.py @@ -370,14 +370,14 @@ def check_answers_word(Word:Word, user_guess:str, prompt:str, is_romaji_type:boo rom_answers = [reading.romaji for reading in Word.readings] + [reading.furigana for reading in Word.readings] reg_answers = [synonym.value for synonym in Word.answers] - if(user_guess == 'q'): ## if the user wants to quit the program do so - Toolkit.exit_seisen() - answers = set(rom_answers) if is_romaji_type else set(reg_answers) alt_answers = set(reg_answers) if is_romaji_type else set(rom_answers) if(user_guess in alt_answers and user_guess not in answers): - user_guess = input(f"\nYou entered a {'reading' if is_romaji_type else 'meaning'} instead of a {'meaning' if is_romaji_type else 'reading'}. Please enter the correct {'meaning' if not is_romaji_type else 'reading'} : ") + user_guess = input(f"\nYou entered a {'reading' if not is_romaji_type else 'meaning'} instead of a {'meaning' if not is_romaji_type else 'reading'}. Please enter the correct {'meaning' if not is_romaji_type else 'reading'} : ") + + if(user_guess == 'q'): ## if the user wants to quit the program do so + Toolkit.exit_seisen() if(user_guess not in answers and user_guess.strip() != ''): ## checks if user_guess is a typo user_guess = ScoreRater.check_typo(Word, user_guess, prompt, is_romaji_type=is_romaji_type)