Tag-Ansicht: pausierte Laeufe als halbhoher weiterlaufender Balken

live.php meldet paused (Idle-Pause/Sim-Pause/phase=paused) + activeUntilMs (letzte
Interaktion). renderLiveSummary: Hauptbalken volle Hoehe bis Pausenbeginn, danach
halbhoher gedaempfter "Pausen-Schwanz" der mit der Zeit weiterwaechst. Legende + tz.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-23 12:02:27 +02:00
parent 5633d3f9f9
commit 3c28794012
2 changed files with 45 additions and 18 deletions
+25 -14
View File
@@ -347,21 +347,32 @@ if ($method === 'GET') {
} elseif (isset($state['score']) && is_numeric($state['score'])) {
$liveScore = max(0, min(100, (int)round($state['score'])));
}
// Pausiert? (Idle-Pause-Overlay oder Sim-Pause). activeUntilMs = letzter
// Interaktionszeitpunkt → der Balken kann ab da halbhoch weitergezeichnet
// werden, solange die Pause läuft.
// Pausiert: Plattform-Idle-Pause, Sim-Pause ODER die Sim meldet phase=paused
// (z. B. Klima bei Geschwindigkeit 0). activeUntilMs = letzter Interaktions-
// zeitpunkt → ab da wird der Balken halbhoch weitergezeichnet.
$isPaused = !empty($state['__idlePaused']) || !empty($state['__paused'])
|| (isset($state['phase']) && $state['phase'] === 'paused');
$activeUntil = isset($state['__lastInteractionAt']) ? (int)$state['__lastInteractionAt'] : 0;
$byStudent[$sid]['sessions'][] = [
'simId' => $simId,
'simTitle' => $mi['title'] ?? $simId,
'simIcon' => $mi['icon'] ?? '📚',
'lessonKind' => $lessonKind,
'lessonLabel' => $lessonLabel,
'startMs' => $startMs,
'endMs' => $endMs,
'durationSec' => $durSec,
'stars' => null,
'score' => $liveScore,
'completed' => null,
'success' => 'running',
'rowCount' => 1,
'isLive' => true,
'simId' => $simId,
'simTitle' => $mi['title'] ?? $simId,
'simIcon' => $mi['icon'] ?? '📚',
'lessonKind' => $lessonKind,
'lessonLabel' => $lessonLabel,
'startMs' => $startMs,
'endMs' => $endMs,
'durationSec' => $durSec,
'stars' => null,
'score' => $liveScore,
'completed' => null,
'success' => 'running',
'rowCount' => 1,
'isLive' => true,
'paused' => $isPaused,
'activeUntilMs'=> ($activeUntil > $startMs && $activeUntil < $endMs) ? $activeUntil : 0,
];
$byStudent[$sid]['totalSec'] += $durSec;
}