[split-required] Split 500-850 LOC files (batch 2)
backend-lehrer (10 files): - game/database.py (785 → 5), correction_api.py (683 → 4) - classroom_engine/antizipation.py (676 → 5) - llm_gateway schools/edu_search already done in prior batch klausur-service (12 files): - orientation_crop_api.py (694 → 5), pdf_export.py (677 → 4) - zeugnis_crawler.py (676 → 5), grid_editor_api.py (671 → 5) - eh_templates.py (658 → 5), mail/api.py (651 → 5) - qdrant_service.py (638 → 5), training_api.py (625 → 4) website (6 pages): - middleware (696 → 8), mail (733 → 6), consent (628 → 8) - compliance/risks (622 → 5), export (502 → 5), brandbook (629 → 7) studio-v2 (3 components): - B2BMigrationWizard (848 → 3), CleanupPanel (765 → 2) - dashboard-experimental (739 → 2) admin-lehrer (4 files): - uebersetzungen (769 → 4), manager (670 → 2) - ChunkBrowserQA (675 → 6), dsfa/page (674 → 5) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
110
klausur-service/backend/pdf_export_styles.py
Normal file
110
klausur-service/backend/pdf_export_styles.py
Normal file
@@ -0,0 +1,110 @@
|
||||
"""
|
||||
PDF Export - Constants and ReportLab styles for Abiturkorrektur PDFs.
|
||||
"""
|
||||
|
||||
from reportlab.lib import colors
|
||||
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
|
||||
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
|
||||
|
||||
|
||||
# =============================================
|
||||
# CONSTANTS
|
||||
# =============================================
|
||||
|
||||
GRADE_POINTS_TO_NOTE = {
|
||||
15: "1+", 14: "1", 13: "1-",
|
||||
12: "2+", 11: "2", 10: "2-",
|
||||
9: "3+", 8: "3", 7: "3-",
|
||||
6: "4+", 5: "4", 4: "4-",
|
||||
3: "5+", 2: "5", 1: "5-",
|
||||
0: "6"
|
||||
}
|
||||
|
||||
CRITERIA_DISPLAY_NAMES = {
|
||||
"rechtschreibung": "Sprachliche Richtigkeit (Rechtschreibung)",
|
||||
"grammatik": "Sprachliche Richtigkeit (Grammatik)",
|
||||
"inhalt": "Inhaltliche Leistung",
|
||||
"struktur": "Aufbau und Struktur",
|
||||
"stil": "Ausdruck und Stil"
|
||||
}
|
||||
|
||||
CRITERIA_WEIGHTS = {
|
||||
"rechtschreibung": 15,
|
||||
"grammatik": 15,
|
||||
"inhalt": 40,
|
||||
"struktur": 15,
|
||||
"stil": 15
|
||||
}
|
||||
|
||||
|
||||
# =============================================
|
||||
# STYLES
|
||||
# =============================================
|
||||
|
||||
def get_custom_styles():
|
||||
"""Create custom paragraph styles for Gutachten."""
|
||||
styles = getSampleStyleSheet()
|
||||
|
||||
# Title style
|
||||
styles.add(ParagraphStyle(
|
||||
name='GutachtenTitle',
|
||||
parent=styles['Heading1'],
|
||||
fontSize=16,
|
||||
spaceAfter=12,
|
||||
alignment=TA_CENTER,
|
||||
textColor=colors.HexColor('#1e3a5f')
|
||||
))
|
||||
|
||||
# Subtitle style
|
||||
styles.add(ParagraphStyle(
|
||||
name='GutachtenSubtitle',
|
||||
parent=styles['Heading2'],
|
||||
fontSize=12,
|
||||
spaceAfter=8,
|
||||
spaceBefore=16,
|
||||
textColor=colors.HexColor('#2c5282')
|
||||
))
|
||||
|
||||
# Section header
|
||||
styles.add(ParagraphStyle(
|
||||
name='SectionHeader',
|
||||
parent=styles['Heading3'],
|
||||
fontSize=11,
|
||||
spaceAfter=6,
|
||||
spaceBefore=12,
|
||||
textColor=colors.HexColor('#2d3748'),
|
||||
borderColor=colors.HexColor('#e2e8f0'),
|
||||
borderWidth=0,
|
||||
borderPadding=0
|
||||
))
|
||||
|
||||
# Body text
|
||||
styles.add(ParagraphStyle(
|
||||
name='GutachtenBody',
|
||||
parent=styles['Normal'],
|
||||
fontSize=10,
|
||||
leading=14,
|
||||
alignment=TA_JUSTIFY,
|
||||
spaceAfter=6
|
||||
))
|
||||
|
||||
# Small text for footer/meta
|
||||
styles.add(ParagraphStyle(
|
||||
name='MetaText',
|
||||
parent=styles['Normal'],
|
||||
fontSize=8,
|
||||
textColor=colors.grey,
|
||||
alignment=TA_LEFT
|
||||
))
|
||||
|
||||
# List item
|
||||
styles.add(ParagraphStyle(
|
||||
name='ListItem',
|
||||
parent=styles['Normal'],
|
||||
fontSize=10,
|
||||
leftIndent=20,
|
||||
bulletIndent=10,
|
||||
spaceAfter=4
|
||||
))
|
||||
|
||||
return styles
|
||||
Reference in New Issue
Block a user