diff --git a/App/sims/heli/game.html b/App/sims/heli/game.html index 54086e3..3a261c9 100644 --- a/App/sims/heli/game.html +++ b/App/sims/heli/game.html @@ -464,10 +464,13 @@ window.GGS_LIVE_STATE = function () { var POST_START = ['flight','approach','landing','results']; var startDone = phase && POST_START.indexOf(phase) >= 0; var landingDone = phase === 'results'; + // In der Auftragswahl/Briefing (keine aktive Mission) das letzte Ergebnis zeigen. + var atSelect = (!phase || phase === 'mission' || phase === 'briefing'); + var lr = (atSelect && game.lastResult) ? game.lastResult : null; return { phase: phase, - missionId: m.id || null, - missionTitle: m.title || null, + missionId: m.id || (lr ? lr.missionId : null), + missionTitle: m.title || (lr ? lr.missionTitle : null), heliKey: (m.heliKey || (m.base && BASE_CONFIG[m.base] && BASE_CONFIG[m.base].heliKey)) || null, heliName: (m.base ? displayHeliName(m.base) : null), stationCallsign: game.stationCallsign || null, @@ -475,9 +478,11 @@ window.GGS_LIVE_STATE = function () { planTotal: routeLen ? routeLen - 1 : 0, planCorrect: game.planCorrect || 0, planAttempts: game.planAttempts || 0, - startScore: startDone ? (game.startScore || 0) : null, - landingScore: landingDone ? (game.landingScore || 0) : null, - totalStars: landingDone ? (game.totalStars || 0) : null, + startScore: startDone ? (game.startScore || 0) : (lr ? lr.startScore : null), + landingScore: landingDone ? (game.landingScore || 0) : (lr ? lr.landingScore : null), + totalStars: landingDone ? (game.totalStars || 0) : (lr ? lr.totalStars : null), + lastResult: lr ? true : false, + lastFailed: lr ? !!lr.failed : false, failed: !!game.missionFailed, missionStartedAt: game.missionStartedAt || null, // Laufender 0–100-Score für die Ampelfarbe im Lehrer-Live (Tag-Balken). @@ -1840,6 +1845,18 @@ function initResultsPhase() { if (game.planTakeover) planStars = 0; var totalStars = Math.round((planStars + game.startScore + game.landingScore) / 3); game.totalStars = totalStars; + // Snapshot des zuletzt abgeschlossenen Einsatzes — damit die Lehrer-Ansicht + // „Aktuell" in der Auftragswahl (zwischen zwei Missionen) noch das letzte + // Ergebnis (Start/Landung/Gesamt) zeigt statt leerer Spalten. + game.lastResult = { + missionId: game.mission ? game.mission.id : null, + missionTitle: game.mission ? game.mission.title : null, + planStars: planStars, + startScore: game.startScore || 0, + landingScore: game.landingScore || 0, + totalStars: totalStars, + failed: !!game.missionFailed, + }; // Assessment-Hook 3: Mission-Ende (mit Sterne + Dauer) assessmentComplete(); // Submit ans Lehrer-Cockpit (player_progress + student_results) diff --git a/App/teacher.html b/App/teacher.html index bdb5a26..b529c50 100644 --- a/App/teacher.html +++ b/App/teacher.html @@ -905,7 +905,12 @@ var LIVE_PRIMARY_FIELDS = { var s = row.state||{}; if (v === true) return '⚠ Chefpilot'; if (s.phase === 'results') return '✓ Erfolg'; - if (s.phase === 'mission' || !s.phase) return 'wählt Auftrag'; + if (s.phase === 'mission' || !s.phase) { + if (s.lastResult) return s.lastFailed + ? '⚠ letzter Einsatz' + : '✓ letzter Einsatz'; + return 'wählt Auftrag'; + } return '🟢 unterwegs'; }}, ],