Lehrer-Drilldown: grafische Kennzahlen, Avatar-Bild, Sterne & Abzeichen
- sim-metrics.js: kuratiertes Feld-Schema pro Sim (Sterne/Prozentbalken/ Verhältnis/Geld/Temperatur), technische Felder ausgeblendet, sauber benannt - Drilldown zeigt Avatar als Bild (avatar:<slug>), Erfolg als Sterne, Parameter als grafische Kacheln, Abzeichen-Sammlung pro gespielter Sim - live.php student_runs liefert player_progress fuer die Abzeichen Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -466,6 +466,10 @@ if ($method === 'GET') {
|
||||
[$studentId]);
|
||||
$active = $live && ((int)$live['last_seen_ts'] >= time() - LIVE_ACTIVE_WINDOW_SEC);
|
||||
|
||||
$progress = $db->fetchAll(
|
||||
'SELECT sim_id, plays, best_stars, level FROM player_progress WHERE student_id = ?',
|
||||
[$studentId]);
|
||||
|
||||
// Recency-Kennzahlen aus den Läufen
|
||||
$recentScores = []; $daysSince = null;
|
||||
foreach ($runs as $i => $r) {
|
||||
@@ -480,6 +484,9 @@ if ($method === 'GET') {
|
||||
'emoji' => $stu['emoji_avatar'] ?: '🧑🎓',
|
||||
'recentErfolg' => $recentErfolg,
|
||||
'daysSince' => $daysSince,
|
||||
'progress' => array_map(function ($p) {
|
||||
return ['simId'=>$p['sim_id'], 'plays'=>(int)$p['plays'], 'best_stars'=>(int)$p['best_stars'], 'level'=>(int)$p['level']];
|
||||
}, $progress),
|
||||
'live' => $active ? ['moduleId' => $live['module_id'], 'state' => json_decode($live['state_json'], true)] : null,
|
||||
'runs' => array_map(function ($r) {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user