- FastAPI backend with JWT auth, roles (admin/moderator/user) - PDF upload (up to 500MB) with streaming, PyMuPDF text extraction - ChromaDB vectorization per page with metadata - LiteLLM AI question extraction from PDF (not generation) - Image extraction from PDF pages, graceful fallback - Quiz modes: timed (countdown timer) + learning (answers shown inline) - Page-by-page question navigation with dot navigator - TTS endpoint using LiteLLM (Google Vertex / OpenAI voices) - Admin dashboard: AI model management per task, user role management - Moderator role: upload PDFs, create sections, generate quizzes - Spaced repetition reminders via SMTP email (SM-2 intervals) - APScheduler daily reminder jobs - Celery + Redis for background PDF processing - React frontend with all pages - Docker Compose deployment (nginx + backend + celery + redis) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
819 B
Python
20 lines
819 B
Python
from sqlalchemy import Column, Integer, String, Text, JSON, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.database import Base
|
|
|
|
|
|
class Question(Base):
|
|
__tablename__ = "questions"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
quiz_id = Column(Integer, ForeignKey("quizzes.id"), nullable=False)
|
|
question_text = Column(Text, nullable=False)
|
|
question_type = Column(String, nullable=False) # mcq, true_false, fill_blank
|
|
options = Column(JSON, nullable=True) # list of strings for mcq
|
|
correct_answer = Column(String, nullable=False)
|
|
explanation = Column(Text, nullable=True)
|
|
page_reference = Column(Integer, nullable=True)
|
|
image_path = Column(String, nullable=True) # path to extracted image, if any
|
|
|
|
quiz = relationship("Quiz", back_populates="questions")
|