leistung_pct-Fundament (Teacher+Backend bevorzugen) + Tempo-Button-Zustaende

- teacher.html _leistungPct: von der Sim geliefertes s.leistung_pct hat
  Vorrang, sonst zentrale Ableitung (Fallback).
- live.php extractScore: leistung_pct (0-100) hat Vorrang vor score/Sterne.
- admin-styleguide.html: Tempo-Button zeigt IMMER den Stand (1x/2x/8x Auto/
  Pause); Toggle-Verhalten (Panel bleibt offen bis erneutem Klick) beschrieben.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-25 12:31:23 +02:00
parent 7e1a7c5228
commit 539f6b012e
3 changed files with 22 additions and 1 deletions
+3 -1
View File
@@ -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-% (0100) 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;
};