Energiemanager: Blackouts fuer Lehrer sichtbar machen
- game.html: bei Blackout sofort action:'blackout' an /progress feuern (setId/Tag/Block/Frequenz/Ursache, score:0) — Fehlversuch bleibt auch bei Set-Abbruch sichtbar, kein player_progress/Sterne. - progress.php: neuer action:'blackout' -> eigene assessments-Zeile, KEIN XP/plays/best_stars. - live.php: Blackout-Flag (event:'blackout') durch die Tag-Summary reichen (blackout/blackoutCount pro Session). - teacher.html: needsHelp energiemanager (>=2 Blackouts oder Tag <4/8); Blackout-Spalte + '🔌 neu planen'-Status in Aktuell; Tag-Balken als 🔌 Blackout kennzeichnen; Run-Karte: eigenes Blackout-Kaertchen + '🔌 N Blackouts'-Badge im fertigen Set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -211,6 +211,8 @@ if ($method === 'GET') {
|
||||
'score' => null,
|
||||
'durationMs' => 0,
|
||||
'completed' => null,
|
||||
'blackout' => false,
|
||||
'blackoutCount' => 0,
|
||||
'rowCount' => 0,
|
||||
];
|
||||
}
|
||||
@@ -224,6 +226,9 @@ if ($method === 'GET') {
|
||||
if ($dmv > $currentSess['durationMs']) $currentSess['durationMs'] = $dmv;
|
||||
$cp = $extractCompleted($row);
|
||||
if ($cp !== null) $currentSess['completed'] = $cp;
|
||||
// Blackout-Fehlversuch (Energiemanager) markieren.
|
||||
$rEvt = $row['results'] ? json_decode($row['results'], true) : [];
|
||||
if (($rEvt['event'] ?? '') === 'blackout') { $currentSess['blackout'] = true; $currentSess['blackoutCount']++; }
|
||||
$prevTs = $ts;
|
||||
}
|
||||
if ($currentSess !== null) $sessions[] = $currentSess;
|
||||
@@ -276,6 +281,8 @@ if ($method === 'GET') {
|
||||
'stars' => $s['stars'],
|
||||
'score' => $s['score'],
|
||||
'completed' => $s['completed'],
|
||||
'blackout' => $s['blackout'],
|
||||
'blackoutCount' => $s['blackoutCount'],
|
||||
'success' => $success,
|
||||
'rowCount' => $s['rowCount'],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user