/sew9-2425-worttrainer-mjozepovic

sew9-2425-worttrainer-mjozepovic created by GitHub Classroom

Primary LanguageJava

sew9-2425-worttrainer-mjozepovic

Overview

The WordCoach Project is a Java-based educational tool designed to improve vocabulary through interactive word-image pairing exercises. The program allows users to guess words based on displayed images, tracks their progress, and saves their session for later continuation.


Features

  • Interactive GUI with JFrame for user interaction.
  • Tracks statistics such as total attempts and correct guesses.
  • Saves and loads session data using JSON serialization via the Jackson library.
  • Randomized word selection to keep the game engaging.
  • Customizable list of word-image pairs.
  • Error handling for invalid inputs and URLs.

Project Structure

The project is structured as follows:

src/
├── main/
│   ├── java/
│   │   ├── main/
│   │   │   └── Main.java
│   │   ├── model/
│   │   │   ├── WordCoach.java
│   │   │   └── WordPair.java
│   │   ├── persistenz/
│   │   │   ├── SessionSaver.java
│   │   │   └── SessionSaverJson.java
│   │   └── view/
│   │       └── View.java
│   └── resources/
│       └── wordcoach.json

Requirements

  • Java 17 or later
  • Jackson Library
  • An IDE or build tool supporting Gradle or Maven

Installation

  1. Clone the repository to your local machine:
    git clone https://github.com/your-repository/wordcoach.git
  2. Open the project in your IDE (e.g., IntelliJ IDEA, Eclipse).
  3. Add the Jackson library to your project:
    • Gradle:
      implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
    • Maven:
      <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
          <version>2.15.2</version>
      </dependency>
  4. Run the Main class to start the application.

How to Use

  1. Launch the application by running Main.java.
  2. Follow the on-screen instructions:
    • Enter your guess for the displayed word.
    • The app will notify you if your guess was correct or not.
  3. View statistics (total attempts and correct guesses) at any time.
  4. Stop the program to save your progress automatically.
  5. Relaunch the app to resume from your last session.

Classes

Main

  • Entry point of the application. Handles initial setup and session management.

WordCoach

  • Core logic for managing word pairs, tracking statistics, and random word selection.

WordPair

  • Represents a single word-image pair with validation for proper URLs.

SessionSaver

  • Interface for session saving and loading functionality.

SessionSaverJson

  • Implementation of SessionSaver using JSON for persistence.

View

  • Swing-based GUI for user interaction and displaying game data.

Sample Word Pairs

The application includes the following preloaded word-image pairs:

Word Image URL
Dog Link
Cat Link
Rat Link
Mouse Link
Tiger Link
Hamster Link

Contributing

Contributions are welcome! Feel free to fork the project, make improvements, and submit a pull request.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments