Per-Sim leistung_pct: alle 14 Sims senden das eine Leistungs-% (0-100)

Jede Sim liefert jetzt selbst leistung_pct in GGS_LIVE_STATE UND im Submit
(Fundament fuer das einheitliche %-System) — kein Rueckrechnen aus Sternen
mehr, keine 0-3-Sonderfaelle. Formeln je Sim wie vereinbart:
- klima/fluss/kofferdetektiv/heli: = vorhandener 0-100-score
- weltkueche: richtige/(richtige+falsche)*100 (Fehler in %)
- busfahrt/fluggesellschaft: topoPunkte/(Auftraege*3)*100
- farmer: gewichteter totalScore; energiemanager: ausgegl./gesamt -15/Blackout
- eu-werkstatt: firstTry/Schritte -5/Muelleimer; sonnensystem: Erstversuch-Quote
- tourismustal: Ziele+Zufriedenheit+Natur gewichtet; tourismusregion: gewichteter score
- logistik: Kontostand->% (sendet erstmals eine Kennzahl, auch an /api/assessment)
Teacher _leistungPct + live.php extractScore bevorzugen bereits diesen Wert.
Additive Aenderungen, bestehende Logik/Sterne unveraendert; alle 15 Dateien
syntaktisch geprueft.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-25 12:35:56 +02:00
parent 539f6b012e
commit 88e3c09e5c
15 changed files with 116 additions and 0 deletions
+2
View File
@@ -1333,6 +1333,7 @@ window.GGS_LIVE_STATE = function () {
// Laufender Punktestand (0100, gleiche Formel wie am Ende) → Ampelfarbe im
// Lehrer-Live (Tag-Ansicht färbt laufende Balken danach ein).
score: _liveKlimaScore(),
leistung_pct:_liveKlimaScore(),
};
};
// Live-Score aus dem aktuellen Stand — nur während des Spiels sinnvoll.
@@ -3876,6 +3877,7 @@ function endLevel(won, reason) {
action: 'submit_assessment',
data: {
level: state.difficulty, stars, score,
leistung_pct: Math.max(0, Math.min(100, Math.round(score))),
duration_ms: durationMs, completed: state.levelWon,
results: {
final_co2: Math.round(state.co2Ppm),
+2
View File
@@ -1573,6 +1573,7 @@ window.GGS_LIVE_STATE = function () {
// Laufender Punktestand (0100, gleiche Formel wie am Ende) → Ampelfarbe im
// Lehrer-Live (Tag-Ansicht färbt laufende Balken danach ein).
score: _liveKlimaScore(),
leistung_pct:_liveKlimaScore(),
};
};
// Live-Score aus dem aktuellen Stand — nur während des Spiels sinnvoll.
@@ -5347,6 +5348,7 @@ function endLevel(won, reason) {
action: 'submit_assessment',
data: {
level: state.difficulty, stars, score,
leistung_pct: Math.max(0, Math.min(100, Math.round(score))),
duration_ms: durationMs, completed: state.levelWon,
results: {
final_co2: Math.round(state.co2Ppm),