diff --git a/App/sims/weltkueche/game.html b/App/sims/weltkueche/game.html
index cbe9fb8..5199f3c 100644
--- a/App/sims/weltkueche/game.html
+++ b/App/sims/weltkueche/game.html
@@ -618,7 +618,7 @@ const BADGES = [
];
/* ====================== STATE ====================== */
-let state={name:"",score:0,badges:[],completed:[],totalCorrect:0,cleanIngredients:0};
+let state={name:"",score:0,badges:[],completed:[],totalCorrect:0,totalWrong:0,cleanIngredients:0,startedAt:0};
let map,markerLayer,current;
const store={get(k,d){try{const v=localStorage.getItem(k);return v?JSON.parse(v):d;}catch(e){return d;}},set(k,v){try{localStorage.setItem(k,JSON.stringify(v));}catch(e){}}};
@@ -639,6 +639,7 @@ async function startGame(){
try { await loadWeltkuecheData(); }
catch (e) { alert('Daten konnten nicht geladen werden: ' + e.message); return; }
}
+ wkLoadProgress(); // bereits geschaffte Gerichte (dieser Browser) wiederherstellen
// Name aus Plattform-Session — kein Eingabefeld mehr
state.name = (window.WK_STUDENT_NAME && window.WK_STUDENT_NAME !== 'Gast') ? window.WK_STUDENT_NAME : 'Forscher:in';
document.getElementById('statName').textContent = state.name;
@@ -792,6 +793,8 @@ window.GGS_LIVE_STATE = function() {
ingCurrent: (current && current.dish && current.idx{});
+ } catch(_){}
+}
+
/* ====================== DISH GRID ====================== */
let _activeFilter = 'all';
function renderDishes(){
@@ -839,7 +880,7 @@ window.setDishFilter = setDishFilter;
/* ====================== GAME ====================== */
function openDish(id){
const dish=DISHES.find(d=>d.id===id);
- current={dish,idx:0,solved:[],dishScore:0,mistakesInDish:0,found:[],wrongHere:0,wrongStreak:0};
+ current={dish,idx:0,solved:[],dishScore:0,mistakesInDish:0,found:[],wrongHere:0,wrongStreak:0,startTs:Date.now()};
// Aufgabe-Cache reset pro Gericht — neue Korrekt-Auswahl + neue Distraktoren
_taskCache = {};
showRecipeScreen(dish);
@@ -1243,7 +1284,7 @@ function guess(key){
updateHUD(); renderIngList();
} else {
b.classList.add('wrong'); b.disabled=true;
- current.wrongStreak++; current.wrongHere++; current.mistakesInDish++;
+ current.wrongStreak++; current.wrongHere++; current.mistakesInDish++; state.totalWrong++;
showWrong(key, cls, ingKey);
setTimeout(()=>playSfx('ingredient-wrong'), 120);
}
@@ -1569,6 +1610,8 @@ function finishDish(){
if(!state.completed.includes(d.id)) state.completed.push(d.id);
playSfx('dish-complete');
const perfect=current.mistakesInDish===0;
+ wkSaveProgress(); // Schüler-Reload merkt sich geschaffte Gerichte
+ wkSubmitProgress(d, perfect); // Lehrer-Historie + Kennzahlen ans Backend
const newly=[];
if(perfect) newly.push(...awardLive(['perfect']));
newly.push(...awardLive(['dish']));