Weltküche: echte Hauptlieferanten statt Zufall + Einheiten-Fix
- Welt-Zutaten: die 2 tatsächlichen Hauptlieferanten nach Menge (Pfeffer → Vietnam+Brasilien, Kakao → Elfenbeinküste+Ghana) statt log-gewichtetem Zufall, der kleine Produzenten (Sri Lanka, Kambodscha) fast gleich oft zog - Reihenfolge: „beliefert unseren Markt" (eu/global) vor „selten hier" (world-far) - fmtTonnes: „220.000 t/Jahr" statt „220 Tsd t" (kindgerecht, kein SI-Kürzel kt), Mio mit deutschem Dezimalkomma („1,5 Mio t") Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1033,8 +1033,16 @@ function buildTaskFor(ingKey) {
|
|||||||
const sourcePool = euRelevant.length >= 2 ? euRelevant : allProducers;
|
const sourcePool = euRelevant.length >= 2 ? euRelevant : allProducers;
|
||||||
const climatePossible = (ing.climate_possible || []).filter(c => C[c]);
|
const climatePossible = (ing.climate_possible || []).filter(c => C[c]);
|
||||||
|
|
||||||
// 2 korrekte aus EU-relevanten Producern, weighted-random
|
// Die 2 tatsächlichen HAUPTLIEFERANTEN — nicht mehr gewürfelt, sondern nach
|
||||||
const correct = weightedSample(sourcePool, Math.min(2, sourcePool.length));
|
// echter Menge, damit die Antwort logisch nachvollziehbar ist (schwarzer
|
||||||
|
// Pfeffer → Vietnam + Brasilien, nicht Sri Lanka + Kambodscha). Wer unseren
|
||||||
|
// Markt beliefert (eu/global), kommt vor „Big Player, der bei uns selten
|
||||||
|
// ankommt" (world-far); innerhalb einer Stufe zählt die Tonnage.
|
||||||
|
const MARKET_TIER = { 'eu': 0, 'global': 0, 'world-far': 1 };
|
||||||
|
const rankedPool = [...sourcePool].sort((a, b) =>
|
||||||
|
((MARKET_TIER[a.market] ?? 2) - (MARKET_TIER[b.market] ?? 2)) ||
|
||||||
|
(((ing.producers[b.key] || {}).t || 0) - ((ing.producers[a.key] || {}).t || 0)));
|
||||||
|
const correct = rankedPool.slice(0, Math.min(2, rankedPool.length)).map(p => p.key);
|
||||||
|
|
||||||
// 2-4 Distraktoren: 1-2 aus climate_possible (für didaktisches Feedback),
|
// 2-4 Distraktoren: 1-2 aus climate_possible (für didaktisches Feedback),
|
||||||
// Rest aus klar-unmöglichen
|
// Rest aus klar-unmöglichen
|
||||||
@@ -1127,8 +1135,8 @@ function loadIngredient(){
|
|||||||
if(current.idx>=d.ings.length){ finishDish(); return; }
|
if(current.idx>=d.ings.length){ finishDish(); return; }
|
||||||
const ingKey = d.ings[current.idx];
|
const ingKey = d.ings[current.idx];
|
||||||
const ing=ingOf(current.idx);
|
const ing=ingOf(current.idx);
|
||||||
// Aufgabe NEU bauen — pro Zutat-Besuch unterschiedliche Korrekt-Auswahl,
|
// Aufgabe frisch bauen (Cache leeren). Die Korrekt-Auswahl ist bewusst
|
||||||
// damit nicht immer Vietnam+Indien beim Pfeffer kommt.
|
// deterministisch: Heimat-Regel bzw. echte Hauptlieferanten nach Menge.
|
||||||
delete _taskCache[ingKey];
|
delete _taskCache[ingKey];
|
||||||
const task = buildTaskFor(ingKey);
|
const task = buildTaskFor(ingKey);
|
||||||
current.found=[]; current.wrongHere=0; current.wrongStreak=0; current.attempted=new Set();
|
current.found=[]; current.wrongHere=0; current.wrongStreak=0; current.attempted=new Set();
|
||||||
@@ -1209,8 +1217,10 @@ function guess(key){
|
|||||||
/* ====================== ERGEBNIS-KARTEN ====================== */
|
/* ====================== ERGEBNIS-KARTEN ====================== */
|
||||||
function fmtTonnes(t) {
|
function fmtTonnes(t) {
|
||||||
if (!t || t <= 0) return '';
|
if (!t || t <= 0) return '';
|
||||||
if (t >= 1000000) return (t/1000000).toFixed(t >= 10000000 ? 0 : 1).replace('.0','') + ' Mio t/Jahr';
|
// Für Sek I lieber die volle Zahl mit Tausenderpunkt (220.000 t) als „220 Tsd t"
|
||||||
if (t >= 10000) return (t/1000).toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g, '.') + ' Tsd t/Jahr';
|
// oder das SI-Kürzel „kt", das die Altersgruppe nicht kennt. Millionen bleiben
|
||||||
|
// als „Mio t" gut lesbar.
|
||||||
|
if (t >= 1000000) return (t/1000000).toFixed(t >= 10000000 ? 0 : 1).replace('.0','').replace('.', ',') + ' Mio t/Jahr';
|
||||||
return t.toLocaleString('de-DE') + ' t/Jahr';
|
return t.toLocaleString('de-DE') + ' t/Jahr';
|
||||||
}
|
}
|
||||||
function regionsHTML(keys){
|
function regionsHTML(keys){
|
||||||
|
|||||||
Reference in New Issue
Block a user