35 lines
598 B
Python
35 lines
598 B
Python
from pydantic import BaseModel
|
|
|
|
|
|
class DifficultyCount(BaseModel):
|
|
"""Count of questions by difficulty."""
|
|
|
|
easy: int
|
|
medium: int
|
|
hard: int
|
|
|
|
|
|
class CategoryCount(BaseModel):
|
|
"""Question count for a category."""
|
|
|
|
name: str
|
|
slug: str
|
|
count: int
|
|
|
|
|
|
class PatternCount(BaseModel):
|
|
"""Question count for a pattern."""
|
|
|
|
name: str
|
|
slug: str
|
|
count: int
|
|
|
|
|
|
class StatsResponse(BaseModel):
|
|
"""Overall statistics response."""
|
|
|
|
total_questions: int
|
|
by_difficulty: DifficultyCount
|
|
by_category: list[CategoryCount]
|
|
by_pattern: list[PatternCount]
|