Add configuration and database core

This commit is contained in:
ameer
2026-05-02 02:59:34 +08:00
parent f5ac80a7a5
commit f689b8f297
5 changed files with 234 additions and 1 deletions

View File

@@ -1 +1,32 @@
"""Pydantic request and response models."""
from __future__ import annotations
from typing import Any
from pydantic import BaseModel, Field
class JoinRequest(BaseModel):
student_id: str = Field(min_length=1, max_length=80)
name: str = Field(min_length=1, max_length=120)
class AdminLoginRequest(BaseModel):
password: str
class QuizCreateRequest(BaseModel):
title: str | None = None
pool_json: dict[str, Any] | str
time_limit_default: int | None = None
class SessionCreateRequest(BaseModel):
quiz_id: int
class SubmitMessage(BaseModel):
type: str
question_idx: int
answer: str