Skip to content

This is a Java-based Quiz Application that allows users to create profiles, update profiles, and take quizzes with a timer. The application interacts with a MySQL database to store user data and quiz responses.

Notifications You must be signed in to change notification settings

Jayphad/CoreJava-Project-Zensar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Quiz Application

This is a Java-based Quiz Application that allows users to create profiles, update profiles, and take quizzes with a timer. The application interacts with a MySQL database to store user data and quiz responses.

Features

  • User Registration and Login: Users can create accounts, log in, and update their profiles.
  • Quiz Functionality:
    • Real-time countdown timer for each question.
    • Automatic submission when time runs out.
    • Tracks scores and stores user responses in the database.
  • MySQL Integration: Stores users, quiz questions, and answers in a relational database.

Prerequisites

  • Java: JDK 8 or later.
  • MySQL: Ensure MySQL is installed and running.
  • Database Setup: Create the database and required tables using the SQL script provided below.

Steps to Compile and Run

  1. Compile the Java Code and Run the Program:
    javac -cp ".:lib/mysql-connector-java-8.0.11.jar" Main.java 
    java -cp ".;lib/mysql-connector-java-8.0.11.jar" Main

Database Schema

Run the following SQL script to set up the database:

CREATE DATABASE quiz_app;

USE quiz_app;

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL
);

CREATE TABLE mcqs (
    id INT AUTO_INCREMENT PRIMARY KEY,
    question TEXT NOT NULL,
    option_a VARCHAR(255) NOT NULL,
    option_b VARCHAR(255) NOT NULL,
    option_c VARCHAR(255) NOT NULL,
    option_d VARCHAR(255) NOT NULL,
    correct_option CHAR(1) NOT NULL
);

CREATE TABLE user_answers (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT NOT NULL,
    question_id INT NOT NULL,
    selected_option CHAR(1),
    FOREIGN KEY (user_id) REFERENCES users(id),
    FOREIGN KEY (question_id) REFERENCES mcqs(id)
);

About

This is a Java-based Quiz Application that allows users to create profiles, update profiles, and take quizzes with a timer. The application interacts with a MySQL database to store user data and quiz responses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages