[split-required] Split final 43 files (500-668 LOC) to complete refactoring
klausur-service (11 files): - cv_gutter_repair, ocr_pipeline_regression, upload_api - ocr_pipeline_sessions, smart_spell, nru_worksheet_generator - ocr_pipeline_overlays, mail/aggregator, zeugnis_api - cv_syllable_detect, self_rag backend-lehrer (17 files): - classroom_engine/suggestions, generators/quiz_generator - worksheets_api, llm_gateway/comparison, state_engine_api - classroom/models (→ 4 submodules), services/file_processor - alerts_agent/api/wizard+digests+routes, content_generators/pdf - classroom/routes/sessions, llm_gateway/inference - classroom_engine/analytics, auth/keycloak_auth - alerts_agent/processing/rule_engine, ai_processor/print_versions agent-core (5 files): - brain/memory_store, brain/knowledge_graph, brain/context_manager - orchestrator/supervisor, sessions/session_manager admin-lehrer (5 components): - GridOverlay, StepGridReview, DevOpsPipelineSidebar - DataFlowDiagram, sbom/wizard/page website (2 files): - DependencyMap, lehrer/abitur-archiv Other: nibis_ingestion, grid_detection_service, export-doclayout-onnx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
65
backend-lehrer/generators/quiz_models.py
Normal file
65
backend-lehrer/generators/quiz_models.py
Normal file
@@ -0,0 +1,65 @@
|
||||
"""
|
||||
Quiz Models - Datenmodelle fuer Quiz-Generierung.
|
||||
|
||||
Enthaelt alle Dataclasses und Enums fuer Quiz-Typen:
|
||||
- True/False Fragen
|
||||
- Zuordnungsaufgaben (Matching)
|
||||
- Sortieraufgaben
|
||||
- Offene Fragen
|
||||
"""
|
||||
|
||||
from typing import List, Any, Optional
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class QuizType(str, Enum):
|
||||
"""Typen von Quiz-Aufgaben."""
|
||||
TRUE_FALSE = "true_false"
|
||||
MATCHING = "matching"
|
||||
SORTING = "sorting"
|
||||
OPEN_ENDED = "open_ended"
|
||||
|
||||
|
||||
@dataclass
|
||||
class TrueFalseQuestion:
|
||||
"""Eine Wahr/Falsch-Frage."""
|
||||
statement: str
|
||||
is_true: bool
|
||||
explanation: str
|
||||
source_reference: Optional[str] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class MatchingPair:
|
||||
"""Ein Zuordnungspaar."""
|
||||
left: str
|
||||
right: str
|
||||
hint: Optional[str] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class SortingItem:
|
||||
"""Ein Element zum Sortieren."""
|
||||
text: str
|
||||
correct_position: int
|
||||
category: Optional[str] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class OpenQuestion:
|
||||
"""Eine offene Frage."""
|
||||
question: str
|
||||
model_answer: str
|
||||
keywords: List[str]
|
||||
points: int = 1
|
||||
|
||||
|
||||
@dataclass
|
||||
class Quiz:
|
||||
"""Ein komplettes Quiz."""
|
||||
quiz_type: QuizType
|
||||
title: str
|
||||
questions: List[Any] # Je nach Typ unterschiedlich
|
||||
topic: Optional[str] = None
|
||||
difficulty: str = "medium"
|
||||
Reference in New Issue
Block a user