fix: Restore all files lost during destructive rebase
A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.
This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).
Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
68
klausur-service/backend/models/exam.py
Normal file
68
klausur-service/backend/models/exam.py
Normal file
@@ -0,0 +1,68 @@
|
||||
"""
|
||||
Klausur-Service Exam Models
|
||||
|
||||
Data classes for Klausur and StudentKlausur.
|
||||
"""
|
||||
|
||||
from dataclasses import dataclass, asdict
|
||||
from datetime import datetime
|
||||
from typing import Optional, List, Dict, Any
|
||||
|
||||
from .enums import KlausurModus, StudentKlausurStatus
|
||||
|
||||
|
||||
@dataclass
|
||||
class StudentKlausur:
|
||||
"""A student's exam work."""
|
||||
id: str
|
||||
klausur_id: str
|
||||
student_name: str
|
||||
student_id: Optional[str]
|
||||
file_path: Optional[str]
|
||||
ocr_text: Optional[str]
|
||||
status: StudentKlausurStatus
|
||||
criteria_scores: Dict[str, Dict]
|
||||
gutachten: Optional[Dict]
|
||||
raw_points: int
|
||||
grade_points: int
|
||||
created_at: datetime
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Convert to dictionary for JSON serialization."""
|
||||
d = asdict(self)
|
||||
d['status'] = self.status.value if hasattr(self.status, 'value') else self.status
|
||||
d['created_at'] = self.created_at.isoformat()
|
||||
return d
|
||||
|
||||
|
||||
@dataclass
|
||||
class Klausur:
|
||||
"""An exam/Klausur with associated student works."""
|
||||
id: str
|
||||
title: str
|
||||
subject: str
|
||||
modus: KlausurModus
|
||||
class_id: Optional[str]
|
||||
year: int
|
||||
semester: str
|
||||
erwartungshorizont: Optional[Dict]
|
||||
students: List[StudentKlausur]
|
||||
created_at: datetime
|
||||
teacher_id: str
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Convert to dictionary for JSON serialization."""
|
||||
return {
|
||||
'id': self.id,
|
||||
'title': self.title,
|
||||
'subject': self.subject,
|
||||
'modus': self.modus.value,
|
||||
'class_id': self.class_id,
|
||||
'year': self.year,
|
||||
'semester': self.semester,
|
||||
'erwartungshorizont': self.erwartungshorizont,
|
||||
'student_count': len(self.students),
|
||||
'students': [s.to_dict() for s in self.students],
|
||||
'created_at': self.created_at.isoformat(),
|
||||
'teacher_id': self.teacher_id
|
||||
}
|
||||
Reference in New Issue
Block a user