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:
@@ -3514,6 +3514,17 @@ window.GGS_LIVE_STATE = function () {
|
||||
var screen = document.getElementById('obs-overlay');
|
||||
var inObs = screen && !screen.classList.contains('obs-hidden');
|
||||
var quote = total > 0 ? Math.round(done/total*100) : 0;
|
||||
// Erst-Treffer-Quote live (bevorzugt), sonst Fortschritt
|
||||
var ftLive = 0, hasFt = false;
|
||||
try {
|
||||
if (obsState && obsState.firstTry && obsState.tasks) {
|
||||
hasFt = true;
|
||||
obsState.tasks.forEach(function(t){ if (obsState.firstTry.has(t.id)) ftLive++; });
|
||||
}
|
||||
} catch (_) {}
|
||||
var leistungPct = (hasFt && total > 0)
|
||||
? Math.max(0, Math.min(100, Math.round(ftLive/total*100)))
|
||||
: quote;
|
||||
var health = 'good';
|
||||
if (inObs) {
|
||||
if (quote >= 75) health = 'good';
|
||||
@@ -3535,6 +3546,7 @@ window.GGS_LIVE_STATE = function () {
|
||||
taskId: t ? t.id : null,
|
||||
completed: done,
|
||||
progressPct: quote,
|
||||
leistung_pct: leistungPct,
|
||||
simDate: simDate,
|
||||
timeDays: dayInt,
|
||||
paused: (typeof paused === 'boolean') ? paused : false,
|
||||
@@ -3989,6 +4001,7 @@ function obsShowEnd() {
|
||||
completed: done, total: total,
|
||||
firstTryCount: firstTryN,
|
||||
firstTryQuote: Math.round(quote*100),
|
||||
leistung_pct: Math.max(0, Math.min(100, Math.round(quote*100))),
|
||||
scoreQuote: Math.round(quote*100),
|
||||
firstTry: (firstTryN >= total), // legacy: alle auf Anhieb
|
||||
stars: stars,
|
||||
|
||||
Reference in New Issue
Block a user