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