Open
Conversation
|
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! 😊 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
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
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!