feat(training+controls): interactive video pipeline, training blocks, control generator, CE libraries
Some checks failed
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Failing after 37s
CI/CD / test-python-backend-compliance (push) Successful in 39s
CI/CD / test-python-document-crawler (push) Successful in 26s
CI/CD / test-python-dsms-gateway (push) Successful in 23s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Has been skipped
Some checks failed
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Failing after 37s
CI/CD / test-python-backend-compliance (push) Successful in 39s
CI/CD / test-python-document-crawler (push) Successful in 26s
CI/CD / test-python-dsms-gateway (push) Successful in 23s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Has been skipped
Interactive Training Videos (CP-TRAIN): - DB migration 022: training_checkpoints + checkpoint_progress tables - NarratorScript generation via Anthropic (AI Teacher persona, German) - TTS batch synthesis + interactive video pipeline (slides + checkpoint slides + FFmpeg) - 4 new API endpoints: generate-interactive, interactive-manifest, checkpoint submit, checkpoint progress - InteractiveVideoPlayer component (HTML5 Video, quiz overlay, seek protection, progress tracking) - Learner portal integration with automatic completion on all checkpoints passed - 30 new tests (handler validation + grading logic + manifest/progress + seek protection) Training Blocks: - Block generator, block store, block config CRUD + preview/generate endpoints - Migration 021: training_blocks schema Control Generator + Canonical Library: - Control generator routes + service enhancements - Canonical control library helpers, sidebar entry - Citation backfill service + tests - CE libraries data (hazard, protection, evidence, lifecycle, components) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -130,3 +130,97 @@ def render_title_slide(
|
||||
result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
|
||||
if result.returncode != 0:
|
||||
raise RuntimeError(f"ImageMagick title slide failed: {result.stderr}")
|
||||
|
||||
|
||||
def render_checkpoint_slide(
|
||||
title: str,
|
||||
question_preview: str,
|
||||
question_count: int,
|
||||
output_path: str,
|
||||
) -> None:
|
||||
"""Render a checkpoint slide with red border and quiz preview."""
|
||||
border_width = 12
|
||||
cmd = [
|
||||
"convert",
|
||||
"-size", f"{WIDTH}x{HEIGHT}",
|
||||
"xc:white",
|
||||
# Red border (full rectangle, then white inner)
|
||||
"-fill", "#c0392b",
|
||||
"-draw", f"rectangle 0,0 {WIDTH},{HEIGHT}",
|
||||
"-fill", "white",
|
||||
"-draw", f"rectangle {border_width},{border_width} {WIDTH - border_width},{HEIGHT - border_width}",
|
||||
# Red header bar
|
||||
"-fill", "#c0392b",
|
||||
"-draw", f"rectangle {border_width},{border_width} {WIDTH - border_width},{HEADER_HEIGHT + border_width}",
|
||||
# CHECKPOINT label
|
||||
"-fill", "white",
|
||||
"-font", FONT_BOLD,
|
||||
"-pointsize", "48",
|
||||
"-gravity", "NorthWest",
|
||||
"-annotate", f"+{60 + border_width}+{(HEADER_HEIGHT - 48) // 2 + border_width}",
|
||||
f"CHECKPOINT: {title[:50]}",
|
||||
]
|
||||
|
||||
y_pos = HEADER_HEIGHT + border_width + 60
|
||||
|
||||
# Instruction text
|
||||
cmd.extend([
|
||||
"-fill", "#333333",
|
||||
"-font", FONT,
|
||||
"-pointsize", "32",
|
||||
"-gravity", "NorthWest",
|
||||
"-annotate", f"+80+{y_pos}",
|
||||
"Bitte beantworten Sie die folgenden Fragen,",
|
||||
])
|
||||
y_pos += 44
|
||||
|
||||
cmd.extend([
|
||||
"-fill", "#333333",
|
||||
"-font", FONT,
|
||||
"-pointsize", "32",
|
||||
"-gravity", "NorthWest",
|
||||
"-annotate", f"+80+{y_pos}",
|
||||
"um mit der Schulung fortzufahren.",
|
||||
])
|
||||
y_pos += 80
|
||||
|
||||
# Question preview
|
||||
if question_preview:
|
||||
preview = textwrap.fill(question_preview, width=70)
|
||||
cmd.extend([
|
||||
"-fill", "#666666",
|
||||
"-font", FONT,
|
||||
"-pointsize", "26",
|
||||
"-gravity", "NorthWest",
|
||||
"-annotate", f"+80+{y_pos}",
|
||||
f"Erste Frage: {preview[:120]}...",
|
||||
])
|
||||
y_pos += 50
|
||||
|
||||
# Question count
|
||||
cmd.extend([
|
||||
"-fill", "#888888",
|
||||
"-font", FONT,
|
||||
"-pointsize", "24",
|
||||
"-gravity", "NorthWest",
|
||||
"-annotate", f"+80+{y_pos}",
|
||||
f"{question_count} Fragen in diesem Checkpoint",
|
||||
])
|
||||
|
||||
# Footer
|
||||
cmd.extend([
|
||||
"-fill", "#f0f0f0",
|
||||
"-draw", f"rectangle {border_width},{HEIGHT - FOOTER_HEIGHT - border_width} {WIDTH - border_width},{HEIGHT - border_width}",
|
||||
"-fill", "#c0392b",
|
||||
"-font", FONT_BOLD,
|
||||
"-pointsize", "22",
|
||||
"-gravity", "South",
|
||||
"-annotate", f"+0+{(FOOTER_HEIGHT - 22) // 2 + border_width}",
|
||||
"Video wird pausiert — Quiz im Player beantworten",
|
||||
])
|
||||
|
||||
cmd.append(output_path)
|
||||
|
||||
result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
|
||||
if result.returncode != 0:
|
||||
raise RuntimeError(f"ImageMagick checkpoint slide failed: {result.stderr}")
|
||||
|
||||
Reference in New Issue
Block a user