Skip to content

Feature: Selectable Text Length and Test D…#74

Open
adithyen wants to merge 4 commits into
FOSSCLUB-LBSITW:mainfrom
adithyen:Feature-Selectable-Text-Length-and-Test-Duration-#64
Open

Feature: Selectable Text Length and Test D…#74
adithyen wants to merge 4 commits into
FOSSCLUB-LBSITW:mainfrom
adithyen:Feature-Selectable-Text-Length-and-Test-Duration-#64

Conversation

@adithyen
Copy link
Copy Markdown
Contributor

@adithyen adithyen commented Mar 13, 2026

📌 Description

Brief description of what this PR does.
Add selectable test duration and text length/difficulty settings

🔗 Related Issue

Closes: #64


New UI Controls (settings_frame)

  • Duration selector (ctk.CTkOptionMenu): lets the user choose
    between 15s, 30s, 60s (default), and 120s before starting a test.
  • Text length selector (ctk.CTkOptionMenu): lets the user choose
    between Short Sentence, Paragraph, and Long Text difficulty
    tiers.

Expanded Text Pools (TEXT_POOLS)

Category Content
Short Sentence 10 single-line sentences (~40-60 chars each)
Paragraph 3 multi-sentence paragraphs (~250-350 chars)
Long Text 2 sustained passages (~700-900 chars)

Logic Updates

Area What changed
start_test() Reads duration_var and applies it to self.test_duration; disables settings menus during a test.
begin_test() Reads text_length_var and picks a random text from the matching pool.
update_timer() Uses self.test_duration instead of the old TEST_DURATION constant.
on_duration_change() Updates the timer label immediately when the user changes the dropdown (only when idle).
check_result() Re-enables settings menus after the test completes.
Window geometry Increased from 720×580750×680 to accommodate the new settings row.

Removed / Replaced

  • TEST_DURATION global constant → replaced by DEFAULT_DURATION
    (used only as the initial fallback).
  • SENTENCES flat list → replaced by the TEXT_POOLS dictionary.

📷 Screenshots (if applicable)

image image

✅ Checklist

  • I have tested my changes
  • My code follows project guidelines
  • I have linked the related issue

@adithyen adithyen changed the title Update typing_speed_test.pyFeature: Selectable Text Length and Test D… Feature: Selectable Text Length and Test D… Mar 13, 2026
@FOSSCLUB-LBSITW
Copy link
Copy Markdown
Owner

Hey!there is merge conflict here, please resolve it as soon as possible

@adithyen
Copy link
Copy Markdown
Contributor Author

Hey!there is merge conflict here, please resolve it as soon as possible

Hey @FOSSCLUB-LBSITW can you check whether this is fine for merging without any issues or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Selectable Text Length and Test Duration

2 participants