Skip to content

Comments

Implemented competetion-mode#230

Open
Gupta-02 wants to merge 1 commit intosaurabh-dev-vns:mainfrom
Ewocs:Competetion-Mode
Open

Implemented competetion-mode#230
Gupta-02 wants to merge 1 commit intosaurabh-dev-vns:mainfrom
Ewocs:Competetion-Mode

Conversation

@Gupta-02
Copy link
Contributor

New Typing Competition Modes Implementation Complete!
I've successfully implemented the requested new competition modes for the typing competition platform. Here's what has been added:

🎯 Three Competition Modes Now Available:

  1. Rounds Mode (Traditional) - Default
    Multiple sequential rounds with different texts
    Each round has a time limit
    Participants compete round by round
    Rankings based on average performance across all rounds
  2. Timed Challenge - ⏱️
    Single session with fixed time limit (30-3600 seconds)
    All participants type simultaneously for the entire duration
    One text provided for all participants
    Rankings based on WPM and accuracy achieved within the time limit
  3. Word Count Challenge - 📝
    Target word count (10-1000 words) instead of time limit
    Text pool with multiple texts - participants randomly assigned one
    Competition ends when participant reaches target word count
    Rankings based on WPM and accuracy to complete the challenge
    🔧 Backend Changes:
    Competition Model Updates:
    Added mode field: 'rounds' | 'timed' | 'word-count'
    Added modeConfig object for mode-specific settings:
    timeLimit (seconds) for timed mode
    targetWords (count) for word-count mode
    textPool (array) for word-count mode texts
    Made rounds array optional for non-rounds modes
    API Enhancements:
    Updated /api/create endpoint to accept mode and modeConfig
    Added validation for mode-specific requirements
    Enhanced competition creation logic for different modes
    Socket Handlers:
    New competition.js handler for timed/word-count modes
    startCompetition event for single-session competitions
    competitionStarted/competitionEnded events
    Automatic competition ending for timed mode
    🎨 Frontend Updates:
    Organizer Interface:
    Mode Selection Dropdown with clear descriptions
    Dynamic Configuration Forms:
    Timed: Time limit + challenge text
    Word-Count: Target words + text pool management
    Rounds: Traditional round setup (unchanged)
    Smart UI Controls: Shows appropriate controls based on selected mode
    Single "Start Competition" Button for timed/word-count modes
    Participant Experience:
    Unified Typing Interface works for all modes
    Dynamic Timer Display: Shows time remaining or word count progress
    Real-time Progress Updates with mode-appropriate metrics
    Automatic Competition Ending based on mode rules
    📊 Key Features:
    Timed Challenge:
    Set custom time limits (30s - 1 hour)
    All participants race against the clock
    Real-time leaderboard updates
    Automatic completion when time expires
    Word Count Challenge:
    Set target word counts (10-1000 words)
    Multiple texts in pool for variety
    Random text assignment to participants
    Competition ends when target reached
    Progress shown as "Words: X/Y"
    Enhanced Analytics:
    All modes fully integrated with existing analytics
    Mode-specific metrics and insights
    Comprehensive reporting and export features
    🚀 How to Use:
    Create Competition:

Select desired mode from dropdown
Configure mode-specific settings
Create and share competition code
For Timed Mode:

Set time limit and provide challenge text
Click "Start Competition" when ready
For Word Count Mode:

Set target word count
Add multiple texts to pool
Click "Start Competition" when ready
Participants Join:

Use competition code to join
Experience seamless typing interface
Automatic progression based on mode rules
The implementation maintains full backward compatibility while adding exciting new competition formats that cater to different skill levels and preferences. The platform now supports traditional round-based competitions, high-intensity timed challenges, and goal-oriented word count challenges!

@github-actions
Copy link

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant