Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Quiz Platform Rest API

A high-performance Quiz Engine with automated scoring, N+1 optimized queries, and hierarchical content management. πŸš€

Interactive Swagger Documentation


Interactive Swagger Documentation

πŸ“š Navigation

πŸš€ Live API Documentation

The API is fully documented with drf-yasg. You can test the scoring logic and authentication directly through the interactive interface.

Note: Use the "Authorize" button in Swagger with the format Token <your_key> to access protected endpoints.

πŸ“¦ Technical Highlights

  • N+1 Query Optimization: Database queries are optimized using Django's annotate to ensure single-query efficiency for category and quiz listings, reducing database load significantly.
  • Dynamic Scoring Engine: Automated calculation of quiz results (correct/wrong count and percentage) upon submission, handled securely on the backend.
  • Hierarchical Admin Panel: Integration of django-nested-admin for seamless management of complex Quiz -> Question -> Option relationships in a single view.
  • Environment-Aware Security: Protocol-safe Swagger configuration supporting both HTTP (Development) and HTTPS (Production/PythonAnywhere) with JWT/Token support.

πŸ› οΈ Built With

πŸ“¬ API Endpoints

User & Authentication

Method Endpoint Description
POST /users/register/ New user registration
POST /users/auth/login/ User login & Token retrieval

Quiz Engine

Method Endpoint Description
GET /quiz/ List all Categories (N+1 Optimized)
GET /quiz/quiz/ List all Quizzes with question counts
POST /quiz/<id>/submit/ Submit quiz answers and receive automated score calculation

βš™οΈ Setup & Installation

Local Development

1. Clone & Environment:

git clone [https://github.com/umitarat-dev/quiz-platform-rest-api.git](https://github.com/umitarat-dev/quiz-platform-rest-api.git)
cd quiz-platform-rest-api
python -m venv env
source env/bin/activate  # macOS/Linux
# env\Scripts\activate  # Windows

2. Configuration:

Create a .env file in the root directory:

SECRET_KEY=your_secret_key_here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
ENV_NAME=dev

3. Install & Run:

Create a .env file in the root directory:

pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

πŸ“¬ Contact Information

I am always open to discussing new projects, creative ideas, or opportunities to be part of your visions.

About

πŸ“ High-performance Quiz Engine REST API featuring N+1 query optimization, automated scoring logic, and hierarchical admin management. Built with Django & DRF.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages