Feature: 40 bilingual questions, random 10 game run, difficulty levels, and full i18n support

This commit is contained in:
kobold-ai
2026-09-21 12:33:34 +02:00
parent eafa1f833e
commit cf89cd31c7
15 changed files with 1369 additions and 138 deletions
+5 -1
View File
@@ -33,12 +33,16 @@ def levenshtein_distance(s1: str, s2: str) -> int:
previous_row = current_row
return previous_row[-1]
def is_answer_correct(user_input: str, canonical: str, accepted_raw: str | None = None) -> bool:
def is_answer_correct(user_input: str, canonical: str, accepted_raw: str | None = None, canonical_en: str | None = None) -> bool:
clean_user = normalize_text(user_input)
if not clean_user:
return False
targets = [normalize_text(canonical)]
if canonical_en:
clean_en = normalize_text(canonical_en)
if clean_en and clean_en not in targets:
targets.append(clean_en)
if accepted_raw:
try: