Files
Adminator 1e51ef7def Nachtrag: alle bisher untracked Ordner + hängende Änderungen mit-committen
- Konzept/, didaktik_geografie/, didaktik_simulation/, v2-modules/, v2-platform/
- 12 code-workspace-Files
- STATUS-*.md
- viele M/D/R-Änderungen an bereits getrackten Files
- .gitignore verstärkt: **/.humaninput/, **/secret_keys.txt

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-08 02:27:02 +02:00

431 lines
24 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// Generator für lehrplan-uebersicht.html
$j = json_decode(file_get_contents(__DIR__ . '/lehrplan-synthese-phase3.json'), true);
$s = json_decode(file_get_contents(__DIR__ . '/_phase3_stats.json'), true);
function e($x) { return htmlspecialchars($x, ENT_QUOTES, 'UTF-8'); }
$sims_meta = [
'busfahrt' => ['title' => 'Busfahrt', 'emoji' => 'BUS'],
'energiemanager' => ['title' => 'Energiemanager', 'emoji' => 'ENERG'],
'eu-werkstatt' => ['title' => 'EU-Werkstatt', 'emoji' => 'EU'],
'farmer' => ['title' => 'Farmer', 'emoji' => 'FARM'],
'fluss' => ['title' => 'Fluss', 'emoji' => 'FLUSS'],
'heli' => ['title' => 'Heli', 'emoji' => 'HELI'],
'klima' => ['title' => 'Klima', 'emoji' => 'KLIMA'],
'klima-3d' => ['title' => 'Klima 3D', 'emoji' => 'K3D'],
'logistik' => ['title' => 'Logistik', 'emoji' => 'LOG'],
'sonnensystem' => ['title' => 'Sonnensystem', 'emoji' => 'SOLAR'],
'weltkueche' => ['title' => 'Weltkueche', 'emoji' => 'KOCH'],
];
$active_sims = array_keys($sims_meta);
$countries = ['AT', 'CH', 'DE', 'LI'];
$country_labels = ['AT' => 'AT', 'CH' => 'CH (SG)', 'DE' => 'DE', 'LI' => 'LI'];
// Top-Anker pro Sim aus Synthese: PRO LAND EINER (max 3 = AT+CH+DE)
// Plus: Anker-Zaehlungen pro Sim x Land fuer die Coverage-Ampel
$top_per_sim = [];
$count_sim_country_new = []; // [sim][country] = anzahl
$count_sim_country_existing = []; // bestand aus DB (wird unten gefuellt)
foreach ($active_sims as $sim) {
$top_per_sim[$sim] = ['AT' => null, 'CH' => null, 'DE' => null];
$count_sim_country_new[$sim] = ['AT' => 0, 'CH' => 0, 'DE' => 0, 'LI' => 0];
$count_sim_country_existing[$sim] = ['AT' => 0, 'CH' => 0, 'DE' => 0, 'LI' => 0];
}
foreach ($j['anchors_neu'] as $a) {
foreach ($a['sims'] as $sim) {
if (!isset($top_per_sim[$sim])) continue;
$c = $a['country'];
if (isset($count_sim_country_new[$sim][$c])) {
$count_sim_country_new[$sim][$c]++;
}
// pro Land den ersten Anker als Top-Beispiel speichern
if (in_array($c, ['AT', 'CH', 'DE']) && $top_per_sim[$sim][$c] === null) {
$top_per_sim[$sim][$c] = [
'country' => $c,
'title' => $a['title'],
'reference' => $a['reference'],
'kompetenz' => $a['kompetenz_zuordnung'],
'neu' => true,
];
}
}
}
// Bestand aus DB
try {
require_once 'C:/xampp/htdocs/geograsim/App/php/config/db.php';
$db = getDB();
$stmt = $db->query("SELECT km.module_id, la.country, COUNT(DISTINCT la.id) AS n
FROM lehrplan_anchors la
JOIN kompetenz_modules km ON la.kompetenz_id = km.kompetenz_id
GROUP BY km.module_id, la.country");
foreach ($stmt as $r) {
if (isset($count_sim_country_existing[$r['module_id']][$r['country']])) {
$count_sim_country_existing[$r['module_id']][$r['country']] = (int)$r['n'];
}
}
} catch (Exception $e) { /* lokal not available, fallback 0 */ }
// Ampel-Funktion: Anker-Zahl -> Farbe + Status
// Annahme: pro Land+Sim ist ein guter Abdeckungsgrad >= 4 Anker, OK >= 2, duenn 1, leer 0
function coverage_status($total) {
if ($total >= 6) return ['gut', '🟢', '#4a7c4e', '#e3e9d6'];
if ($total >= 3) return ['ok', '🟡', '#a37e1a', '#fff7e0'];
if ($total >= 1) return ['duenn', '🟠', '#9c4d2e', '#fde0db'];
return ['leer', '🔴', '#9c2e2e', '#fbcfcf'];
}
// Lücken aus den 3 JSON-Files
$gaps = [
[
'thema' => 'Plantage / Monokultur (Begriff)',
'sim_abgedeckt' => 'JA: Farmer-Sim modelliert Cluster-Risiko bei Monokultur; weltkueche zeigt Plantage-Klimabilanz.',
'lehrplan' => 'AT: nicht woertlich. BU 4. Kl. AT spricht von "Charakteristika der konventionellen Landwirtschaft". DE: NRW IF6 + BY-Gym-Geo10-LB7 nennen "Plantagenwirtschaft" woertlich. CH: WAH/RZG.3.2 nennt "Plantage" als Produktionsform.',
'status' => 'teilweise abgedeckt — AT-Lehrplan-Luecke. DE+CH wortwoertlich.',
],
[
'thema' => 'Fair Trade / fairer Handel (Begriff)',
'sim_abgedeckt' => 'NEIN — kein Sim-Konzept dafuer. Sinngemaess: weltkueche Klimabilanz + Farmer Importpreise.',
'lehrplan' => 'Begriff in keinem der Lehrplaene woertlich (AT/CH/DE). Sinngemaess ueber Globalisierungsbereiche.',
'status' => 'Sim-Luecke — Vorschlag: Fair-Trade-Badges in weltkueche-Rezepten.',
],
[
'thema' => 'Klimazonen explizit (Koeppen-Geiger)',
'sim_abgedeckt' => 'JA: Farmer (Sahel-Cluster, Tropen), klima (Klimazonen-Karte), klima-3d.',
'lehrplan' => 'AT: Begriff "Klimazonen" nicht woertlich im GW Sek I. DE: NRW IF5 "Klimazonen der Erde" + BY-Rs-Geo7 "Klima-/Vegetationszonen". CH: RZG.1.2 "Landschaftszonen" + "Kalte/gemaessigte/Subtropen-/Tropenzone".',
'status' => 'AT-Luecke. DE+CH stark verankert. Sim deckt es ab.',
],
[
'thema' => 'EU-Institutionen (Kommission, Parlament, Ministerrat) namentlich',
'sim_abgedeckt' => 'JA: EU-Werkstatt thematisiert Buergerinitiative — Institutionsnamen jedoch implizit.',
'lehrplan' => 'AT: GW 4.2 nennt nur "vier Grundfreiheiten, Euro, Bildungskooperationen". GPB 4. Kl. spricht von EU als Wirtschafts-/Friedensprojekt. Keine Institutionsnamen woertlich. DE: NRW IF7 + BY-Gym-Geo10 thematisieren EU-Politik. CH: RZG.8.3 spricht nur abstrakt von "europaeischer Einigung" + Schweiz-Position.',
'status' => 'Plattform-weite Luecke — kein Lehrplan nennt Kommission/Parlament/Rat woertlich. Atlas-Empfehlung: EU-Werkstatt kann Institutionsnamen einfuehren als Plus.',
],
[
'thema' => 'Systemisches Denken explizit',
'sim_abgedeckt' => 'JA: Plattform-Kompetenz #46 systemisches-denken existiert; logistik + klima nutzen sie.',
'lehrplan' => 'AT: GW 4.3 "Wandel der Machtverhaeltnisse zwischen Staaten ... NGOs, Konzernen". DE: DGfG-F2 "Zusammenwirken von Geofaktoren ... als System darstellen"; NRW SK1 "Geofaktoren-Zusammenwirken". CH: keine eigene Kompetenz, implizit in RZG.3.x.',
'status' => 'DE explizit, AT sinngemaess, CH implizit.',
],
[
'thema' => 'Logistik / Disposition als LP-Anker',
'sim_abgedeckt' => 'JA: logistik-Sim Kern.',
'lehrplan' => 'AT: GW 2.2 + GW 3.3 (Import/Export). DE: NRW IF10 "Just-in-time-Produktion" + DGfG-F3 "Welthandel". CH: WAH.2.2 "globale Warenstroeme, Import/Export, Logistik" woertlich.',
'status' => 'Stark verankert. Plattform-Kompetenz #43 wirtschaft-logistikverstaendnis matcht direkt.',
],
[
'thema' => 'Welternaehrung & Disparitaeten',
'sim_abgedeckt' => 'JA: Weltkueche + Farmer.',
'lehrplan' => 'AT: EH 2. Kl. + UT 13 + GW 1.3. DE: NRW IF7 + BY-Gym-Geo10-LB2 + BY-Rs-Geo9. CH: WAH.4.5 + NMG.7.4 + RZG.2.2.',
'status' => 'In ALLEN drei Laendern explizit. Loest neue Plattform-Kompetenz #108 welternaehrung-konsum-disparitaeten aus.',
],
[
'thema' => 'Plantage / Monokultur als Sim-Mechanik',
'sim_abgedeckt' => 'JA: Farmer-Cluster-Risiko, Schaedlingsanfaelligkeit. Welternaehrung-Sim Rezepte.',
'lehrplan' => 'Siehe oben.',
'status' => 'Sim deckt es voll ab.',
],
];
ob_start();
?><!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Lehrplan-Coverage Phase 3 · GeoGraSim</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Inter',system-ui,sans-serif;background:#f5f2eb;color:#2a2a2a;line-height:1.5;padding:24px;max-width:1400px;margin:0 auto}
h1{color:#1f4e5a;font-size:1.6rem;margin-bottom:4px}
.sub{font-size:.82rem;color:#8a8a8a;margin-bottom:18px}
h2{color:#1f4e5a;font-size:1.15rem;margin:28px 0 10px;padding-bottom:6px;border-bottom:2px solid #4a7c8a;display:flex;align-items:center;gap:8px}
h3{color:#4a7c8a;font-size:.98rem;margin:18px 0 8px}
table{width:100%;border-collapse:collapse;font-size:.84rem;background:#fff;border-radius:6px;overflow:hidden;margin-bottom:10px}
th,td{text-align:left;padding:7px 10px;border-bottom:1px solid #e0ddd4;vertical-align:top}
th{background:#1f4e5a;color:#fff;font-weight:600;font-size:.74rem;text-transform:uppercase;letter-spacing:.04em}
tr:hover{background:#fafaf5}
tr:last-child td{border-bottom:none}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums;font-weight:600}
td.num .delta{color:#4a7c4e;font-size:.78em;margin-left:4px}
td.num .delta.zero{color:#bbb}
td.zero{color:#cfcfcf}
code{background:#f5f2eb;padding:2px 6px;border-radius:3px;font-family:'JetBrains Mono',Consolas,monospace;font-size:.85em}
a{color:#1f4e5a}
.badge{display:inline-block;font-size:.68rem;font-weight:700;padding:2px 7px;border-radius:9999px;margin-right:4px}
.b-new{background:#e3e9d6;color:#4a6b3f}
.b-existing{background:#d6e3e9;color:#1f4e5a}
.b-country-at{background:#fde0db;color:#9c4d2e}
.b-country-ch{background:#fff7e0;color:#8a6516}
.b-country-de{background:#d6e3e9;color:#1f4e5a}
.b-country-li{background:#e0ddd4;color:#666}
.top-nav{background:#fff;border:1px solid #e0ddd4;border-radius:8px;padding:10px 14px;margin-bottom:18px;font-size:.86rem;display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.top-nav a{text-decoration:none;padding:5px 11px;border-radius:6px;color:#1f4e5a}
.top-nav a:hover{background:#f5f2eb}
.top-nav a.active{background:#1f4e5a;color:#fff}
.info-box{background:#fff7e0;border-left:4px solid #d2a24c;padding:12px 16px;margin:14px 0;border-radius:0 6px 6px 0;font-size:.88rem}
.stat-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:14px}
.stat-card{background:#fff;border-radius:8px;padding:12px 16px;border:1px solid #e0ddd4}
.stat-card .label{font-size:.72rem;text-transform:uppercase;color:#888;font-weight:700;letter-spacing:.04em}
.stat-card .value{font-size:1.8rem;font-weight:800;color:#1f4e5a;line-height:1.1;margin-top:2px}
.stat-card .delta{font-size:.85rem;color:#4a7c4e;font-weight:600}
.sim-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px;margin-top:14px}
.sim-card{background:#fff;border:1px solid #e0ddd4;border-radius:8px;padding:14px 16px}
.sim-card h4{color:#1f4e5a;font-size:.98rem;margin-bottom:8px;display:flex;align-items:center;gap:8px}
.sim-card .counts{font-size:.78rem;color:#666;margin-bottom:10px}
.sim-card .counts b{color:#1f4e5a}
.sim-card ul{list-style:none;padding:0;font-size:.84rem}
.sim-card li{padding:6px 0;border-bottom:1px dotted #e0ddd4}
.sim-card li:last-child{border-bottom:none}
.gap-list .gap-item{background:#fff;border:1px solid #e0ddd4;border-left:4px solid #d2a24c;border-radius:0 6px 6px 0;padding:12px 16px;margin-bottom:10px}
.gap-item h4{color:#1f4e5a;font-size:.95rem;margin-bottom:6px}
.gap-item .gap-line{font-size:.84rem;margin-top:4px}
.gap-item .gap-line b{color:#1f4e5a}
.gap-item .status{display:inline-block;font-size:.72rem;font-weight:700;padding:3px 10px;border-radius:9999px;background:#fff7e0;color:#8a6516;margin-top:6px}
.gap-item .status.full{background:#e3e9d6;color:#4a6b3f}
.gap-item .status.partial{background:#fde0db;color:#9c4d2e}
.matrix-table th.col-sim,.matrix-table td.col-sim{background:#fafaf5;font-weight:600;color:#1f4e5a}
.matrix-table td.cell{text-align:center;font-variant-numeric:tabular-nums}
.matrix-table td.cell.zero{color:#cfcfcf}
.matrix-table td.cell .new{display:inline-block;color:#4a7c4e;font-weight:700;font-size:.78em;margin-left:3px}
details{background:#fff;border:1px solid #e0ddd4;border-radius:6px;margin-bottom:8px}
details summary{padding:10px 14px;cursor:pointer;font-weight:600;color:#1f4e5a;font-size:.92rem}
details[open] summary{border-bottom:1px solid #e0ddd4}
details > div{padding:0 14px 12px}
.note{font-size:.78rem;color:#888;font-style:italic;margin-top:6px}
</style>
</head>
<body>
<nav class="top-nav">
<strong>Entwurfswerkzeug</strong>
<a href="index.html">Uebersicht</a>
<a href="../entwurf.html">Entwurf</a>
<a href="../review.html">Review</a>
<a href="accounts.html">Accounts</a>
<a href="standards.html">Standards</a>
<a href="lehrplan-uebersicht.html" class="active">Lehrplan-Coverage</a>
<a href="../../App/admin-sitemap.html" target="_blank">Sitemap</a>
</nav>
<h1>Lehrplan-Coverage Phase 3</h1>
<p class="sub">Stand: 2026-06-08 · Synthese-Snapshot AT/CH/DE/LI · Quelle: <code>.dontDeploy/entwurfswerkzeug/lehrplan-synthese-phase3.json</code></p>
<div style="background:#fff;border-radius:8px;padding:14px 18px;margin:14px 0;border:1px solid #e0ddd4">
<h3 style="color:#1f4e5a;margin:0 0 8px;font-size:1rem">📖 Was du auf dieser Seite siehst — kurz erklärt</h3>
<ul style="font-size:.9rem;line-height:1.6;margin:0;padding-left:1.4em;color:#3a3a3a">
<li><b>Anker</b> = ein wörtlicher Verweis aus einem Schul-Lehrplan auf eines unserer Sim-Themen.
Beispiel: AT-Lehrplan GW Kompetenz 3.3 sagt wörtlich „Import/Export — Außenwirtschaft Österreichs". Das ist ein Anker für unsere Busfahrt/Logistik/Weltküche-Sims.
Jeder Anker hat Land · Fach · Klassenstufe · wörtliches Zitat · Quelle-URL.</li>
<li><b>Plattform-Kompetenz</b> = einer von 14 (mit der neuen 15) intern definierten Sammelbegriffen wie „Klimawandel", „Welthandel", „Kartenkompetenz". Jede Sim ist mehreren zugeordnet. Anker werden indirekt über die Plattform-Kompetenz mit der Sim verknüpft.</li>
<li><b>Coverage / Abdeckung</b> = wie viele Anker wir pro Sim und pro Land haben. Wir zeigen <b>keine Prozente</b>, weil es keine geschlossene Soll-Liste „Lehrplan = 100 Anker" gibt. Stattdessen <b>Ampel</b>:
<span style="background:#e3e9d6;color:#4a6b3f;padding:2px 8px;border-radius:9999px;font-weight:700;font-size:.8em">🟢 gut ≥ 6</span>
<span style="background:#fff7e0;color:#a37e1a;padding:2px 8px;border-radius:9999px;font-weight:700;font-size:.8em">🟡 ok 35</span>
<span style="background:#fde0db;color:#9c4d2e;padding:2px 8px;border-radius:9999px;font-weight:700;font-size:.8em">🟠 dünn 12</span>
<span style="background:#fbcfcf;color:#9c2e2e;padding:2px 8px;border-radius:9999px;font-weight:700;font-size:.8em">🔴 leer 0</span></li>
<li><b>Bestand vs. neu:</b> „Bestand" = was schon in der DB war. „Neu" = was Phase-3-Recherche zusätzlich vorschlägt (noch nicht in DB — muss erst per SQL-Migration übernommen werden).</li>
</ul>
</div>
<div class="info-box">
<b>Quellen:</b> Bestand-Zahlen aus DB (<code>lehrplan_anchors</code>, <?=count($s['komp_titles'])-1?> Plattform-Kompetenzen).
Neu-Zahlen aus Phase-2-Synthese: AT-RIS BGBl. II 1/2023 (BMBWF Sek I + VS), CH-LP21 (Sankt Gallen-Quelle <code>sg.lehrplan.ch</code>), DE-DGfG/NRW/Niedersachsen/Bayern (alles wörtlich aus PDFs extrahiert).
</div>
<h2>Gesamt-Statistik vor und nach Phase 3</h2>
<div class="stat-cards">
<div class="stat-card">
<div class="label">Anker AT (bestand &rarr; neu)</div>
<div class="value"><?=$s['bestand_per_country']['AT']?> &rarr; <?=$s['bestand_per_country']['AT']+($s['neu_per_country']['AT']??0)?></div>
<div class="delta">+<?=$s['neu_per_country']['AT']??0?> aus BGBl. II 1/2023</div>
</div>
<div class="stat-card">
<div class="label">Anker CH (bestand &rarr; neu)</div>
<div class="value"><?=$s['bestand_per_country']['CH']?> &rarr; <?=$s['bestand_per_country']['CH']+($s['neu_per_country']['CH']??0)?></div>
<div class="delta">+<?=$s['neu_per_country']['CH']??0?> aus LP21 (SG)</div>
</div>
<div class="stat-card">
<div class="label">Anker DE (bestand &rarr; neu)</div>
<div class="value"><?=$s['bestand_per_country']['DE']?> &rarr; <?=$s['bestand_per_country']['DE']+($s['neu_per_country']['DE']??0)?></div>
<div class="delta">+<?=$s['neu_per_country']['DE']??0?> DGfG/NRW/NI/BY</div>
</div>
<div class="stat-card">
<div class="label">Anker LI</div>
<div class="value"><?=$s['bestand_per_country']['LI']?> &rarr; <?=$s['bestand_per_country']['LI']?></div>
<div class="delta" style="color:#888">unveraendert</div>
</div>
<div class="stat-card">
<div class="label">Total Anker</div>
<div class="value"><?=array_sum($s['bestand_per_country'])?> &rarr; <?=array_sum($s['bestand_per_country'])+array_sum($s['neu_per_country'])?></div>
<div class="delta">+<?=array_sum($s['neu_per_country'])?> Anker</div>
</div>
<div class="stat-card">
<div class="label">Plattform-Kompetenzen</div>
<div class="value">14 &rarr; 15</div>
<div class="delta">+1 (welternaehrung-konsum-disparitaeten)</div>
</div>
</div>
<h2>Sim &times; Land Matrix</h2>
<p class="sub">Anker pro Sim und Land. Format: <code>bestand</code> mit <span style="color:#4a7c4e;font-weight:700">+neu</span>.</p>
<table class="matrix-table">
<thead>
<tr>
<th class="col-sim">Sim</th>
<?php foreach ($countries as $c): ?>
<th class="num"><?=e($country_labels[$c])?></th>
<?php endforeach; ?>
<th class="num">Sum bestand</th>
<th class="num">Sum neu</th>
</tr>
</thead>
<tbody>
<?php foreach ($active_sims as $sim):
$cells = $s['sim_land_matrix'][$sim];
$sum_b = 0; $sum_n = 0;
foreach ($countries as $c) { $sum_b += $cells[$c]['bestand']; $sum_n += $cells[$c]['neu']; }
?>
<tr>
<td class="col-sim"><?=e($sims_meta[$sim]['title'])?></td>
<?php foreach ($countries as $c): $b = $cells[$c]['bestand']; $n = $cells[$c]['neu']; ?>
<td class="cell <?=($b==0 && $n==0)?'zero':''?>"><?=$b?><?php if($n>0): ?><span class="new">+<?=$n?></span><?php endif; ?></td>
<?php endforeach; ?>
<td class="num"><?=$sum_b?></td>
<td class="num"><span class="delta">+<?=$sum_n?></span></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<h2>Plattform-Kompetenz &times; Land Matrix</h2>
<p class="sub">Anker pro Plattform-Kompetenz und Land.</p>
<table class="matrix-table">
<thead>
<tr>
<th class="col-sim">Kompetenz</th>
<?php foreach ($countries as $c): ?>
<th class="num"><?=e($country_labels[$c])?></th>
<?php endforeach; ?>
<th class="num">Sum bestand</th>
<th class="num">Sum neu</th>
</tr>
</thead>
<tbody>
<?php foreach ($s['komp_titles'] as $kt):
$kid = (int)$kt['id'];
if (!isset($s['komp_land_matrix'][$kid])) {
// neue Kompetenz 108
$s['komp_land_matrix'][$kid] = ['AT'=>['bestand'=>0,'neu'=>0],'CH'=>['bestand'=>0,'neu'=>0],'DE'=>['bestand'=>0,'neu'=>0],'LI'=>['bestand'=>0,'neu'=>0]];
// Neu-Zaehlung aus Synthese
foreach ($j['anchors_neu'] as $a) {
if ($a['kompetenz_zuordnung'] === $kt['key_slug']) {
$s['komp_land_matrix'][$kid][$a['country']]['neu']++;
}
}
}
$cells = $s['komp_land_matrix'][$kid];
$sum_b = 0; $sum_n = 0;
foreach ($countries as $c) { $sum_b += $cells[$c]['bestand']; $sum_n += $cells[$c]['neu']; }
?>
<tr>
<td class="col-sim"><?=e($kt['title'])?> <?php if($kid==108): ?><span class="badge b-new">NEU</span><?php endif; ?><br><span class="note"><code><?=e($kt['key_slug'])?></code></span></td>
<?php foreach ($countries as $c): $b = $cells[$c]['bestand']; $n = $cells[$c]['neu']; ?>
<td class="cell <?=($b==0 && $n==0)?'zero':''?>"><?=$b?><?php if($n>0): ?><span class="new">+<?=$n?></span><?php endif; ?></td>
<?php endforeach; ?>
<td class="num"><?=$sum_b?></td>
<td class="num"><span class="delta">+<?=$sum_n?></span></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<h2>Pro Sim — Abdeckung mit Ampel-System</h2>
<p class="sub">Pro Sim und Land ein Beispiel-Anker (AT/CH/DE) — plus Ampel für die Gesamtzahl der Anker pro Land. <b>🟢 grün</b> ≥ 6 Anker (gut abgedeckt) · <b>🟡 gelb</b> 3-5 (ok) · <b>🟠 orange</b> 1-2 (dünn) · <b>🔴 rot</b> 0 (gar nicht).</p>
<div class="sim-grid">
<?php foreach ($active_sims as $sim):
$cells = $s['sim_land_matrix'][$sim];
$sum_b = 0; $sum_n = 0;
foreach ($countries as $c) { $sum_b += $cells[$c]['bestand']; $sum_n += $cells[$c]['neu']; }
?>
<div class="sim-card">
<h4><?=e($sims_meta[$sim]['title'])?></h4>
<div class="counts">bestand insgesamt: <b><?=$sum_b?></b> Anker · neu aus Phase 3: <b style="color:#4a7c4e">+<?=$sum_n?></b></div>
<?php // Ampel-Zeile pro Land mit Beispiel-Anker ?>
<?php foreach (['AT', 'CH', 'DE'] as $cc):
$total_for_country = $cells[$cc]['bestand'] + $cells[$cc]['neu'];
[$status, $emoji, $color, $bg] = coverage_status($total_for_country);
$example = $top_per_sim[$sim][$cc] ?? null;
?>
<div style="background:<?=$bg?>;border-radius:6px;padding:8px 10px;margin-top:6px">
<div style="display:flex;align-items:center;gap:8px;font-size:.78rem;font-weight:700;color:<?=$color?>">
<span style="font-size:1.1em"><?=$emoji?></span>
<span><?=$cc?> — <?=$total_for_country?> Anker (<?=$status?>)</span>
<?php if ($cells[$cc]['neu'] > 0): ?><span style="margin-left:auto;color:#4a7c4e;font-weight:700">+<?=$cells[$cc]['neu']?> neu</span><?php endif; ?>
</div>
<?php if ($example): ?>
<div style="font-size:.8rem;color:#444;margin-top:4px;line-height:1.4">
<b>Beispiel:</b> <?=e($example['title'])?>
<div class="note" style="margin-top:2px"><?=e($example['reference'])?></div>
</div>
<?php elseif ($total_for_country == 0): ?>
<div style="font-size:.75rem;color:#666;margin-top:4px;font-style:italic">kein Anker — Lehrplan-Lücke oder Sim noch nicht zugeordnet</div>
<?php else: ?>
<div style="font-size:.75rem;color:#666;margin-top:4px;font-style:italic">Anker bereits in der DB (siehe /lehrplan-Page)</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
<h2>Themen-Luecken und Sim-Abdeckung</h2>
<p class="sub">Lehrplan-Begriffe, die in Phase 1 oder 2 als "nicht woertlich abgedeckt" gemeldet wurden — mit Sim-Querverweis.</p>
<div class="gap-list">
<?php foreach ($gaps as $g): ?>
<div class="gap-item">
<h4><?=e($g['thema'])?></h4>
<div class="gap-line"><b>Sim-Abdeckung:</b> <?=e($g['sim_abgedeckt'])?></div>
<div class="gap-line"><b>Lehrplan-Verankerung:</b> <?=e($g['lehrplan'])?></div>
<div class="status <?=(strpos(strtolower($g['status']),'voll')!==false?'full':(strpos(strtolower($g['status']),'teil')!==false?'partial':''))?>"><?=e($g['status'])?></div>
</div>
<?php endforeach; ?>
</div>
<h2>Methodik und Quellen</h2>
<details>
<summary>Datenquellen, Validierungsstatus, Fall-Back-Hinweise</summary>
<div>
<h3>AT — BGBl. II 1/2023</h3>
<p>RIS Rechtsinformationssystem des Bundes. Direkter PDF-Download + pdftotext-Extraktion. Wortwoertliche Zitate. 31 neue Anker.</p>
<p class="note">Quick-Fixes: 9 Subject-Korrekturen (5x "Politische Bildung" -> "Geschichte und Politische Bildung — Querschnitt", 4x "Informatische Bildung" -> "Digitale Grundbildung"). Optional: 33 GW-Anker mit Subject "GW" -> "Geografie und wirtschaftliche Bildung".</p>
<h3>CH — Lehrplan 21 / Kanton St. Gallen</h3>
<p>Quelle: <code>sg.lehrplan.ch</code> (Live-Auftritt Kanton St. Gallen, bestaetigt 2026-06-08 via WebSearch). LP21-Texte national einheitlich.</p>
<p class="note">URL-Verifikation: WebFetch HTTP 403 (Bot-Block) — wie bei v-fe.lehrplan.ch und gr.lehrplan.ch. URL-Schema (Codes b|id|4 fuer Fachbereiche) identisch. Bei manueller Pruefung von Thomas: 1:1-Match zur Stamm-LP21-Struktur erwartet. 41 neue Anker.</p>
<h3>DE — DGfG / NRW / NI / BY</h3>
<p>4 Quellen:</p>
<ul style="padding-left:18px">
<li><b>DGfG Bildungsstandards 2020</b> (10. Aufl., VGDH-PDF): 11 Anker (10 verwertet, DGfG-M2 als Querschnitt weggelassen)</li>
<li><b>NRW Kernlehrplan G9 Erdkunde 2019</b>: 14 Anker</li>
<li><b>Niedersachsen Kerncurriculum Gymnasium Erdkunde</b>: 7 Anker</li>
<li><b>Bayern LehrplanPLUS (Gym 5/7/10 + RS 7/8/9)</b>: 15 Anker</li>
</ul>
<p class="note">Quick-Fix: 4 Anker mit DGfG-Tot-URL <code>geographie.de/publikationen/</code> auf <code>vgdh.de/wp-content/uploads/2023/08/Bildungsstandards_Geographie_2020_Web.pdf</code> aktualisiert.</p>
<h3>Neue Plattform-Kompetenz</h3>
<p><code>welternaehrung-konsum-disparitaeten</code> — konsolidiert die AT-Vorschlagskompetenz "ernaehrungs-und-konsumkompetenz" und die DE-Vorschlagskompetenz "welternaehrung-disparitaeten" zu einer Plattform-Kompetenz mit wortwoertlichen Belegen aus EH 2. Kl. AT, UT 13 AT, NRW IF7, BY-Gym-Geo10-LB2, BY-Rs-Geo9, WAH.2.2 CH, WAH.4.5 CH, NMG.7.4 CH.</p>
</div>
</details>
</body>
</html>
<?php
$html = ob_get_clean();
file_put_contents(__DIR__ . '/lehrplan-uebersicht.html', $html);
echo "HTML geschrieben: " . strlen($html) . " Bytes\n";