@@ -323,6 +330,15 @@
+ Tempo-Button im Header — zeigt IMMER den aktuellen Stand
+
+
+
+
+
+
+ Klick öffnet das Tempo-Panel und lässt es offen bis zum erneuten Klick (Toggle) — genauso beim Musik-Player. Der Button selbst zeigt jederzeit den Speed: 1×, 2×, 8× Auto (z. B. Logistik) oder ⏸ Pause. So bleibt der Zustand sichtbar, ohne dass das Panel offen bleiben muss.
+
Aufgeklappt · Musikplayer (Klick auf das Musik-Icon)
diff --git a/App/php/api/live.php b/App/php/api/live.php
index a46eb6e..dd48716 100644
--- a/App/php/api/live.php
+++ b/App/php/api/live.php
@@ -148,7 +148,9 @@ if ($method === 'GET') {
// sonst der Sim-Score (Farmer/Weltküche liefern `score`).
$extractScore = function($row) {
$r = $row['results'] ? json_decode($row['results'], true) : [];
- foreach ([$r['score'] ?? null, $r['results']['score'] ?? null] as $c) if (is_numeric($c)) return max(0, min(100, (int)round($c)));
+ // Von der Sim geliefertes Leistungs-% (0–100) hat Vorrang, dann score, dann Sterne→%.
+ foreach ([$r['leistung_pct'] ?? null, $r['results']['leistung_pct'] ?? null, $r['data']['leistung_pct'] ?? null,
+ $r['score'] ?? null, $r['results']['score'] ?? null] as $c) if (is_numeric($c)) return max(0, min(100, (int)round($c)));
if (isset($r['stars']) && is_numeric($r['stars'])) return (int)round($r['stars'] / 5 * 100);
return null;
};
diff --git a/App/teacher.html b/App/teacher.html
index c4bb4fe..6e449f1 100644
--- a/App/teacher.html
+++ b/App/teacher.html
@@ -682,6 +682,9 @@ function _pctBadge(pct) {
function _leistungPct(simId, s) {
if (!s || typeof s !== 'object') return null;
var cl = function(v,a,b){ return Math.max(a, Math.min(b, v)); };
+ // Von der Sim selbst geliefertes Leistungs-% hat Vorrang (Fundament-Umbau) —
+ // sonst zentrale Ableitung als Fallback.
+ if (typeof s.leistung_pct === 'number' && !isNaN(s.leistung_pct)) return cl(Math.round(s.leistung_pct), 0, 100);
// Sims mit echtem 0–100-Live-Score (klima, fluss, kofferdetektiv, heli) direkt:
if (typeof s.score === 'number' && simId !== 'weltkueche' && simId !== 'busfahrt' && simId !== 'fluggesellschaft')
return cl(Math.round(s.score), 0, 100);