Skip to content

dinujayawkt/Quickzz--quizapp

Repository files navigation

⚡ Quickzz - Multi-client Real-time Quiz System

A beautiful, modern quiz application with stunning GUI demonstrating core Java network programming concepts:

  • TCP sockets (client/server communication)
  • Multithreading (concurrent client handling)
  • Synchronization (thread-safe scoreboard)
  • UDP broadcasting (final results)
  • Modern Swing UI (dark theme with styled components)

✨ Features

Server GUI

  • 🖥️ Modern Server Dashboard - Beautiful GUI with real-time logs and client list
  • ▶️ One-Click Start/Stop - Easy server control with large buttons
  • 👥 Live Client Monitoring - See connected clients in real-time
  • 📋 Timestamped Logs - Track all server events with timestamps
  • 🎨 Professional Design - Dark theme matching client interface

Client GUI

  • 🎨 Beautiful Dark Theme - Modern, polished interface with smooth interactions
  • 🚀 Real-time Multiplayer - Multiple clients compete simultaneously
  • 📊 Live Score Tracking - See your score update in real-time
  • 🎯 Interactive Answer Buttons - Large, clickable A/B/C/D buttons
  • Instant Feedback - Color-coded correct/wrong indicators
  • 📡 UDP Broadcast Results - Final leaderboard sent to all clients
  • 💪 Larger Windows - 950x750px for comfortable viewing

Structure

Server

  • src/quiz/QuizServer.java (console server)
  • src/quiz/QuizServerGUI.java ⭐ (NEW! GUI server)
  • src/quiz/ClientHandler.java
  • src/quiz/SharedScoreboard.java
  • src/quiz/ResultBroadcaster.java

Client

  • src/quiz/QuizClient.java (console client)
  • src/quiz/QuizClientGUI.java (modern GUI client)
  • src/quiz/UdpResultListener.java

Data

  • src/quiz/QuizQuestion.java
  • src/quiz/QuizData.java

Build

  • Compile:

    • javac -d out src/quiz/*.java
    • OR double-click: compile.bat
  • Run Server GUI ⭐ (Recommended):

    • java -cp out quiz.QuizServerGUI
    • OR double-click: start-server-gui.bat
  • Run Client GUI:

    • java -cp out quiz.QuizClientGUI
    • OR double-click: start-client-gui.bat
  • Run Full Demo (Server GUI + 3 Clients):

    • Double-click: demo.bat

Alternative (Console Mode)

  • Run console server: start-server.bat
  • Run console client: start-client-console.bat

Default ports:

  • TCP server: 5000
  • UDP broadcast: 55555

How it works

  • Server accepts clients concurrently. Each client sends a player name first.
  • Server waits an admission window (15 seconds). Then it starts the quiz for all connected players.
  • Questions are sent one by one to each client via TCP; clients reply with the option letter (A/B/C/D).
  • Server updates a shared, synchronized scoreboard.
  • When the quiz ends, the server sends each client their score via TCP and also broadcasts the final leaderboard using UDP.
  • Clients can listen for the UDP broadcast and display the final results.

Mapping to Concepts

  • TCP Socket Programming: QuizServer, QuizClient, QuizClientGUI
  • Multithreading: ClientHandler (one per client)
  • Synchronization / Shared Data: SharedScoreboard
  • Client-Server Communication: Request/response protocol over TCP
  • UDP Datagram Socket: ResultBroadcaster (server) and UdpResultListener (client)

About

Quizapp-with-plain-java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors