From 26b1791988b01f20c923ba6488366fcd37a8ceb1 Mon Sep 17 00:00:00 2001 From: tekboart Date: Tue, 6 Jan 2026 03:19:13 +0100 Subject: [PATCH 1/4] Define 5 thresholds to define input box (1) [fix] last ver only returned 'ftb-md' (e.g., no ftb-sm, ftb-lg, etc.) (2) added a 'ftb-xl' for text lengh greater than 30 --- fill-the-blanks/src/handler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fill-the-blanks/src/handler.py b/fill-the-blanks/src/handler.py index df3faec..2b95c81 100644 --- a/fill-the-blanks/src/handler.py +++ b/fill-the-blanks/src/handler.py @@ -120,9 +120,12 @@ def _get_length_class(text: str, hint: str): return "ftb-xs" elif size <= 10: return "ftb-sm" - elif size > 20: + elif size <= 20: + return "ftb-md" + elif size <= 30: return "ftb-lg" - return "ftb-md" + else: + return "ftb-xl" def on_show_question(): From 00424be9c2a3b6dcb730fc1163851218f0719544 Mon Sep 17 00:00:00 2001 From: tekboart Date: Tue, 6 Jan 2026 03:20:58 +0100 Subject: [PATCH 2/4] added the required css classes based on handler.py (1) except for 'ftb-md' all other classes were missing (2) added 'ftb-xl' as well (3) the width of each of the added classes are based on 8 (1 letter is almost 8 pixel) --- fill-the-blanks/src/binding.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fill-the-blanks/src/binding.py b/fill-the-blanks/src/binding.py index af86a17..27979f9 100644 --- a/fill-the-blanks/src/binding.py +++ b/fill-the-blanks/src/binding.py @@ -32,8 +32,17 @@ padding: 3px; margin: 2px; } +input.ftb-xs { + width: 40px; +} +input.ftb-sm { + width: 80px; +} input.ftb-md { - width: 150px; + width: 160px; +} +input.ftb-lg { + width: 240px; } input.st-incomplete { background-color: #FFFF77; From cc6473703a6533793d633f209acd2f28fb1a8488 Mon Sep 17 00:00:00 2001 From: tekboart Date: Sat, 10 Jan 2026 02:57:11 +0100 Subject: [PATCH 3/4] added the left out .ftb-xl CSS --- fill-the-blanks/src/binding.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fill-the-blanks/src/binding.py b/fill-the-blanks/src/binding.py index 27979f9..73a3b7c 100644 --- a/fill-the-blanks/src/binding.py +++ b/fill-the-blanks/src/binding.py @@ -44,6 +44,9 @@ input.ftb-lg { width: 240px; } +input.ftb-xl { + width: 240px; +} input.st-incomplete { background-color: #FFFF77; color: #333; From 077567ba3ff886edb2cb41ff1056c9f5375a27d9 Mon Sep 17 00:00:00 2001 From: tekboart Date: Sat, 10 Jan 2026 03:01:34 +0100 Subject: [PATCH 4/4] set width=320px for .ftb-xl --- fill-the-blanks/src/binding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fill-the-blanks/src/binding.py b/fill-the-blanks/src/binding.py index 73a3b7c..667f4d6 100644 --- a/fill-the-blanks/src/binding.py +++ b/fill-the-blanks/src/binding.py @@ -45,7 +45,7 @@ width: 240px; } input.ftb-xl { - width: 240px; + width: 320px; } input.st-incomplete { background-color: #FFFF77;