from pathlib import Path from pydantic import BaseModel, ConfigDict, Field class Question(BaseModel): model_config = ConfigDict(extra="ignore") task_id: str = Field(min_length=1) question: str = Field(min_length=1) file_name: str = "" class Answer(BaseModel): task_id: str = Field(min_length=1) submitted_answer: str = Field(min_length=1) class RunRecord(BaseModel): question: Question attachment: Path | None = None raw_answer: str submitted_answer: str class ScoreResponse(BaseModel): username: str score: float correct_count: int total_attempted: int message: str timestamp: str