Files
breakpilot-lehrer/backend-lehrer/ai_processor/export/print_templates.py
Benjamin Admin bd4b956e3c [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>
2026-04-25 09:41:42 +02:00

245 lines
5.7 KiB
Python

"""
AI Processor - HTML Templates for Print Versions
Contains HTML/CSS header templates for Q&A, Cloze, and Multiple Choice print output.
"""
def get_qa_html_header(title: str) -> str:
"""Get HTML header for Q&A print version."""
return f"""<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>{title} - Fragen</title>
<style>
@media print {{
.no-print {{ display: none; }}
.page-break {{ page-break-before: always; }}
}}
body {{
font-family: Arial, sans-serif;
max-width: 800px;
margin: 40px auto;
padding: 20px;
line-height: 1.6;
}}
h1 {{ font-size: 24px; margin-bottom: 8px; }}
.meta {{ color: #666; margin-bottom: 24px; }}
.question-block {{
margin-bottom: 32px;
padding-bottom: 16px;
border-bottom: 1px dashed #ccc;
}}
.question-number {{ font-weight: bold; color: #333; }}
.question-text {{ font-size: 16px; margin: 8px 0; }}
.answer-lines {{ margin-top: 12px; }}
.answer-line {{ border-bottom: 1px solid #999; height: 28px; }}
.answer {{
margin-top: 8px;
padding: 8px;
background: #e8f5e9;
border-left: 3px solid #4caf50;
}}
.key-terms {{ font-size: 12px; color: #666; margin-top: 8px; }}
.key-terms span {{
background: #fff3e0;
padding: 2px 6px;
border-radius: 3px;
margin-right: 4px;
}}
</style>
</head>
<body>
"""
def get_cloze_html_header(title: str) -> str:
"""Get HTML header for cloze print version."""
return f"""<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>{title} - Lueckentext</title>
<style>
@media print {{
.no-print {{ display: none; }}
.page-break {{ page-break-before: always; }}
}}
body {{
font-family: Arial, sans-serif;
max-width: 800px;
margin: 40px auto;
padding: 20px;
line-height: 1.8;
}}
h1 {{ font-size: 24px; margin-bottom: 8px; }}
.meta {{ color: #666; margin-bottom: 24px; }}
.cloze-item {{
margin-bottom: 24px;
padding: 16px;
background: #f9f9f9;
border-radius: 8px;
}}
.cloze-number {{ font-weight: bold; color: #333; margin-bottom: 8px; }}
.cloze-sentence {{ font-size: 16px; line-height: 2; }}
.gap {{
display: inline-block;
min-width: 80px;
border-bottom: 2px solid #333;
margin: 0 4px;
text-align: center;
}}
.gap-filled {{
display: inline-block;
padding: 2px 8px;
background: #e8f5e9;
border: 1px solid #4caf50;
border-radius: 4px;
font-weight: bold;
}}
.translation {{
margin-top: 12px;
padding: 8px;
background: #e3f2fd;
border-left: 3px solid #2196f3;
font-size: 14px;
color: #555;
}}
.translation-label {{ font-size: 12px; color: #777; margin-bottom: 4px; }}
.word-bank {{
margin-top: 32px;
padding: 16px;
background: #fff3e0;
border-radius: 8px;
}}
.word-bank-title {{ font-weight: bold; margin-bottom: 12px; }}
.word {{
display: inline-block;
padding: 4px 12px;
margin: 4px;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}}
</style>
</head>
<body>
"""
def get_mc_html_header(title: str) -> str:
"""Get HTML header for MC print version."""
return f"""<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>{title} - Multiple Choice</title>
<style>
@media print {{
.no-print {{ display: none; }}
.page-break {{ page-break-before: always; }}
body {{ font-size: 14pt; }}
}}
body {{
font-family: Arial, Helvetica, sans-serif;
max-width: 800px;
margin: 40px auto;
padding: 20px;
line-height: 1.6;
color: #000;
}}
h1 {{
font-size: 28px;
margin-bottom: 8px;
border-bottom: 2px solid #000;
padding-bottom: 8px;
}}
.meta {{ color: #333; margin-bottom: 32px; font-size: 14px; }}
.instructions {{
background: #f5f5f5;
padding: 12px 16px;
border-radius: 4px;
margin-bottom: 24px;
font-size: 14px;
}}
.question-block {{
margin-bottom: 28px;
padding-bottom: 16px;
border-bottom: 1px solid #ddd;
}}
.question-number {{ font-weight: bold; font-size: 18px; color: #000; margin-bottom: 8px; }}
.question-text {{ font-size: 16px; margin: 8px 0 16px 0; line-height: 1.5; }}
.options {{ margin-left: 20px; }}
.option {{
display: flex;
align-items: flex-start;
margin-bottom: 12px;
padding: 8px 12px;
border: 1px solid #ccc;
border-radius: 4px;
background: #fff;
}}
.option-correct {{
background: #e8f5e9;
border-color: #4caf50;
border-width: 2px;
}}
.option-checkbox {{
width: 20px;
height: 20px;
border: 2px solid #333;
border-radius: 50%;
margin-right: 12px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}}
.option-checkbox.checked::after {{
content: "\\2713";
font-weight: bold;
color: #4caf50;
}}
.option-label {{ font-weight: bold; margin-right: 8px; min-width: 24px; }}
.option-text {{ flex: 1; }}
.explanation {{
margin-top: 8px;
padding: 8px 12px;
background: #e3f2fd;
border-left: 3px solid #2196f3;
font-size: 13px;
color: #333;
}}
.answer-key {{
margin-top: 40px;
padding: 16px;
background: #f5f5f5;
border-radius: 8px;
}}
.answer-key-title {{
font-weight: bold;
font-size: 18px;
margin-bottom: 12px;
border-bottom: 1px solid #999;
padding-bottom: 8px;
}}
.answer-key-grid {{
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 8px;
}}
.answer-key-item {{
padding: 8px;
text-align: center;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}}
.answer-key-q {{ font-weight: bold; }}
.answer-key-a {{ color: #4caf50; font-weight: bold; }}
</style>
</head>
<body>
"""