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:
+25
-14
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user