A comprehensive AI-powered examination framework built with Spring Boot, featuring student registration, AI question generation, real-time exams, and intelligent evaluation with detailed reporting.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
- Student Registration: Complete registration system with validation
- Topic Selection: Multiple exam topics with different difficulty levels
- AI Question Generation: OpenAI-powered question generation for dynamic content
- Timer Functionality: Real-time exam timer with automatic submission
- Answer Submission: Interactive exam interface with multiple choice questions
- AI Evaluation: Intelligent answer evaluation using OpenAI
- Detailed Reports: Comprehensive performance analysis and recommendations
- In-memory H2 Database: Embedded database for easy deployment
- Export Options: PDF and JSON report export functionality
- Responsive Web Interface: Modern UI built with Bootstrap and Thymeleaf
- Java 17 or higher
- Maven 3.6 or higher
- OpenAI API Key (for AI features)
git clone <repository-url>
cd aentic_exam_frameworkOption 1: Environment Variable (Recommended)
export OPENAI_API_KEY=your-openai-api-key-hereOption 2: Application Properties
Edit src/main/resources/application.properties and replace:
openai.api.key=${OPENAI_API_KEY:your-openai-api-key-here}with your actual OpenAI API key:
openai.api.key=sk-your-actual-openai-api-keyOption 1: Run as JAR
mvn clean package
java -jar target/exam-framework-1.0.0.jarOption 2: Run with Maven
mvn spring-boot:runOpen your web browser and navigate to:
http://localhost:8080
- Visit
http://localhost:8080/students/register - Fill in the registration form with valid details
- Upon successful registration, you'll be redirected to select a topic
- Choose from available topics (Java, Spring, Database, Web Development, etc.)
- Each topic has different difficulty levels and time limits
- Click "Start Exam" to begin
- Answer multiple-choice questions within the time limit
- Timer displays remaining time in the top-right corner
- Submit answers when complete or wait for automatic submission
- Immediate score display with percentage and grade
- Detailed performance analysis
- Download reports as PDF or JSON
- View detailed reports with AI-powered insights
- Export reports in multiple formats
- Track performance over multiple exams
GET /students/api/{id}- Get student by IDGET /students/api/email/{email}- Get student by emailPOST /students/register- Register new studentPUT /students/api/{id}- Update student detailsDELETE /students/api/{id}- Delete student
GET /topics/api/{id}- Get topic by IDGET /topics/api/all- Get all topicsGET /topics/api/difficulty/{level}- Get topics by difficultyPOST /topics/api- Create new topicPUT /topics/api/{id}- Update topicDELETE /topics/api/{id}- Delete topic
GET /exams/api/{id}- Get exam by IDGET /exams/api/code/{examCode}- Get exam by codeGET /exams/api/student/{studentId}- Get exams by studentPOST /exams/submit- Submit exam answersGET /exams/{examId}/questions- Get exam questions
GET /reports/api/{id}- Get report by IDGET /reports/api/code/{reportCode}- Get report by codeGET /reports/export/pdf/{reportCode}- Export PDF reportGET /reports/export/json/{reportCode}- Export JSON report
The application uses an in-memory H2 database. You can access the H2 console at:
http://localhost:8080/h2-console
Connection Details:
- JDBC URL:
jdbc:h2:mem:examdb - Username:
sa - Password:
password
Key configuration options in src/main/resources/application.properties:
# Server Configuration
server.port=8080
# Database Configuration
spring.datasource.url=jdbc:h2:mem:examdb
spring.datasource.username=sa
spring.datasource.password=password
# OpenAI Configuration
openai.api.key=${OPENAI_API_KEY:your-openai-api-key-here}
# Logging Configuration
logging.level.com.aentic.exam=DEBUGThe application automatically loads sample data including:
- 6 exam topics (Java, Spring, Database, Web Development, Data Structures, System Design)
- 25+ sample questions across different difficulty levels
- Pre-configured exam durations and question counts
To create a runnable JAR file:
mvn clean packageThe JAR file will be created at:
target/exam-framework-1.0.0.jar
Run the JAR:
java -jar target/exam-framework-1.0.0.jar- Uses OpenAI GPT-3.5-turbo for intelligent question creation
- Generates questions based on topic and difficulty level
- Includes multiple choice options, correct answers, and explanations
- Falls back to basic generation if OpenAI is unavailable
- AI-powered performance analysis
- Identifies strengths and improvement areas
- Provides personalized recommendations
- Generates detailed performance summaries
-
OpenAI API Key Error
- Ensure your API key is valid and has sufficient credits
- Check that the environment variable is set correctly
- Verify the API key in application.properties
-
Database Connection Issues
- The H2 database is in-memory and resets on restart
- Access the H2 console to verify database state
-
Port Conflicts
- Change server port in application.properties if 8080 is in use
server.port=8081
-
Build Issues
- Ensure Java 17+ is installed and configured
- Run
mvn cleanbeforemvn package
Check application logs for detailed error information:
tail -f logs/application.logFor issues and questions:
- Check the troubleshooting section above
- Review application logs for error details
- Verify OpenAI API key and connectivity
- Ensure all prerequisites are met
This project is for educational and demonstration purposes.