Quiz Hub — AI-Assisted Student Portal

A Django student portal for generating and taking quizzes, with AI-assisted question generation and role-based access for students, teachers, and admins.

Illustration of a quiz card with multiple-choice options and an AI generation button.
My role
Developer
Type
Academic project
Status
Academic project

Stack

  • Python
  • Django
  • SQLite
  • Bootstrap
  • Google Gemini API
  • OpenAI API
On this page
  1. Overview
  2. The problem
  3. At a glance
  4. Quiz generation flow
  5. Roles and access
  6. AI-assisted quiz generation
  7. Taking quizzes
  8. Limitations

Overview

An academic project built with Django, SQLite, and Bootstrap. Teachers and students can generate quizzes on a topic, take them, and track attempts.

Quiz generation tries Google Gemini first, falls back to OpenAI, and finally to a rule-based generator — so the feature degrades gracefully when an AI service is unavailable.

The problem

Writing good quiz questions takes time. Quiz Hub is an academic project that explores whether AI services can take on the first draft — generating quizzes on a topic — while a Django application handles the parts that need to be reliable: accounts, roles, quiz attempts, and dashboards.

At a glance

  • Custom user model with student, teacher & admin roles
  • Role-based access via decorator and middleware
  • AI quiz generation with a three-step fallback
  • Structured JSON quiz output
  • Quiz attempts tracked per user
  • Role-specific dashboards

Quiz generation flow

Each step only runs if the previous one fails.

5 layers · select a layer for details

  1. Request Topic, difficulty & question types

    A quiz request is submitted to the generation endpoint.

    • Django
  2. Primary Google Gemini

    First choice for generating questions.

    • Gemini API
  3. Fallback OpenAI

    Used if Gemini is unavailable.

    • OpenAI API
  4. Last resort Rule-based generator

    Produces a basic quiz when no AI service responds.

  5. Output Structured quiz JSON

    Parsed into questions, points, and metadata for rendering or storage.

Roles and access

The application uses a custom user model with three roles — student, teacher, and admin — with separate registration flows for students and teachers. Role-based access is enforced by a custom decorator and middleware, and the admin dashboard is restricted to administrators.

AI-assisted quiz generation

A quiz request specifies a topic, the number of questions, a difficulty level, question types, and optional source content. Generation follows a fallback chain:

  1. Google Gemini is tried first.
  2. If that fails, the request falls back to OpenAI.
  3. If neither service is available, a rule-based generator produces a basic quiz, so the feature degrades instead of breaking.

The AI response is parsed into a structured JSON quiz — title, description, questions, and total points — that the application can render or store.

Taking quizzes

Quizzes and user attempts are stored as separate models, so each attempt and its score can be tracked per user and surfaced in role-specific dashboards.

Limitations

  • AI output needs review. Generated questions can be inaccurate or ambiguous; in real use a teacher should review them before students see them.
  • External dependencies. Quality depends on the AI services' availability and behaviour — the fallback chain limits, but doesn't remove, that dependency.
  • Development setup. The project uses SQLite as its default development database.
Abstract illustration of a clinical dashboard with intake form, schedule, and SOAP-note panels. Contains no real data. In production

Healthcare software Professional

EMR & Patient Intake Platform

A production Electronic Medical Record platform covering patient intake, clinical documentation, scheduling, billing, and practice administration.

  • Python
  • Django
  • Django REST Framework
  • JavaScript
  • and 7 more
Login I Lanexis PVT LTD - customer.lanexis.com Completed and deployed

Business platform Client project

Lanexis Customer Portal

A B2B customer portal I planned, designed, built, and deployed end to end Django backend, React Native/Expo app, Google Sheets integration, and AWS infrastructure.

  • Django
  • Django REST Framework
  • React Native
  • Expo
  • and 7 more
Abstract illustration of text messages turning into a TF-IDF matrix and an SVM decision boundary. Internship project

Machine learning Internship

SMS Spam Classification

An SVM text classifier that separates spam from legitimate SMS messages using TF-IDF features, tuned with GridSearchCV.

  • Python
  • scikit-learn
  • SVM
  • TF-IDF
  • and 2 more

→Get in touch

Working on something similar?

I’m happy to talk through the problem, the trade-offs, and how I’d approach it.