This is a simple and educational word game designed for kids to help them learn new words and improve their vocabulary. The game presents words from a CSV file and tracks the user's progress, selecting new words to challenge them and reinforcing words they struggle with.
- Random Word Selection: The game selects words randomly from a CSV file, ensuring a varied learning experience.
- Adaptive Learning: The game tracks which words the user struggles with and adjusts the word selection to help improve their retention.
- User Progress Tracking: The game records the user's performance, allowing for personalized word selection based on past performance.
- Easy Installation: The game is easy to set up and run on your local machine.
-
Install Docker:
- Follow the official Docker installation guide for your operating system.
-
Clone the Repository:
git clone https://github.com/TartuDen/WordGame2 cd WordGame2 -
Create and Configure Docker Environment:
- Create a .env file in the root directory if it doesn’t already exist and add your environment variables. For example:
GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret DB_PASS=your_postgresql_password DB_PORT=5432 SESSION_SECRET=your_session_secret
-
Build and Start the Docker Containers: Run the following command to build and start the application and database containers:
docker-compose up --build- Access the Game: Open your browser and navigate to http://localhost:8081 to start playing.
- Install Dependencies: Make sure you have Node.js installed. Then run:
npm install- Set Up Environment Variables: Create a .env file in the root directory and add your environment variables. Example:
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
DB_PASS=your_postgresql_password
DB_PORT=5432- Run the Game:
npm start- Access the Game: Open your browser and navigate to http://localhost:8081 to start playing.
Word Selection Process
- Initial Setup:
- The game reads a list of words from a CSV file.
- It also keeps track of words the user has already encountered, how many times they guessed them correctly, and how many times they guessed them wrong.
- Adaptive Word Selection:
- Struggled Words: Words that the user has guessed wrong more than 20% of the time are considered "struggled words." The game prioritizes these words to help reinforce learning.
- Less Difficult Words: Every 5th word selected by the game is a word that the user has guessed wrong less than 20% of the time. This helps to review less difficult words periodically.
- New Words: If no struggled words are found, or based on the word selection interval, the game selects a new word that the user has not encountered before.
- Detailed Word Selection:
- The function selectWordForUser alternates between selecting a new word or a word the user struggles with.
- It toggles between these two modes to balance learning new words and reinforcing old ones.
- The struggle percentage is logged to provide visual feedback on how the words are selected based on user performance.
- First Selection: A new word that the user hasn't encountered before is selected.
- Second Selection: A word that the user has struggled with (if any) is selected.
- Every 5th Selection: A less difficult word (guessed wrong <20% of the time) is selected to review.
Feel free to fork this repository and submit pull requests to improve the game. Contributions are welcome!
This project is open-source and available under the MIT License.