import React, { useState, useMemo } from ‘react’;
import { Heart, MessageCircle, Coffee, CheckCircle2, XCircle, RefreshCcw, ArrowRight, User } from ‘lucide-react’;
const examTasks = [
{
id: 1,
type: “function”,
character: “Babcia”,
situation: “Wchodzisz do domu babci. Ona mówi: ‘It’s so good to see you!'”,
question: “Co odpowiesz?”,
options: [“Nice to see you too!”, “I am fine.”, “You’re welcome.”, “Good luck.”],
correct: “Nice to see you too!”,
hint: “Kiedy ktoś cieszy się z Twojego widoku, wypada odwzajemnić miłe powitanie.”
},
{
id: 2,
type: “phrasal”,
character: “Dziadek”,
situation: “Dziadek szuka okularów. Mówi: ‘Can you help me ___ my glasses?'”,
question: “Wybierz czasownik:”,
options: [“look for”, “look after”, “look at”, “look up”],
correct: “look for”,
hint: “Szukać czegoś to ‘look ___’.”
},
{
id: 3,
type: “function”,
character: “Babcia”,
situation: “Babcia proponuje Ci herbatę: ‘Would you like some tea?'”,
question: “Jak grzecznie odmówisz?”,
options: [“No, I don’t.”, “No, thank you.”, “I’m sorry.”, “Please, no.”],
correct: “No, thank you.”,
hint: “Grzeczne ‘nie, dziękuję’ to podstawa na egzaminie.”
},
{
id: 4,
type: “phrasal”,
character: “Dziadek”,
situation: “Dziadek prosi, żebyś nie przerywał nauki: ‘Don’t stop, just ___ working.'”,
question: “Wybierz czasownik:”,
options: [“carry on”, “carry out”, “get on”, “get up”],
correct: “carry on”,
hint: “‘Carry on’ oznacza kontynuować czynność.”
},
{
id: 5,
type: “function”,
character: “Babcia”,
situation: “Babcia dziękuje Ci za pomoc w ogrodzie: ‘Thank you for your help!'”,
question: “Co odpowiesz?”,
options: [“Not at all.”, “No problem.”, “You’re welcome.”, “Wszystkie powyższe są poprawne.”],
correct: “Wszystkie powyższe są poprawne.”,
hint: “W angielskim jest wiele sposobów, by powiedzieć ‘nie ma za co’.”
},
{
id: 6,
type: “phrasal”,
character: “Dziadek”,
situation: “Dziadek prosi o wyłączenie telewizora: ‘Can you ___ the TV? I want to sleep.'”,
question: “Wybierz czasownik:”,
options: [“turn off”, “turn on”, “turn up”, “turn down”],
correct: “turn off”,
hint: “Wyłączamy urządzenia za pomocą ‘turn ___’.”
},
{
id: 7,
type: “function”,
character: “Babcia”,
situation: “Chcesz zapytać babcię o drogę do najbliższej apteki.”,
question: “Jak zaczniesz pytanie?”,
options: [“Tell me…”, “Excuse me, how can I get to…”, “Where is…”, “I want to go to…”],
correct: “Excuse me, how can I get to…”,
hint: “Zawsze zaczynaj od uprzejmego ‘Excuse me’, gdy o coś pytasz.”
},
{
id: 8,
type: “phrasal”,
character: “Dziadek”,
situation: “Dziadek mówi, żebyś uważał na siebie: ‘___ care on your way home!'”,
question: “Wybierz czasownik:”,
options: [“Take”, “Make”, “Give”, “Do”],
correct: “Take”,
hint: “Zwrot ‘uważać na siebie’ to ‘___ care’.”
},
{
id: 9,
type: “function”,
character: “Babcia”,
situation: “Babcia źle się czuje. Co jej powiesz?”,
question: “Wybierz reakcję:”,
options: [“I’m sorry to hear that.”, “That’s great!”, “Never mind.”, “It’s okay.”],
correct: “I’m sorry to hear that.”,
hint: “Kiedy słyszysz złą wiadomość, użyj ‘I’m sorry to hear that’.”
},
{
id: 10,
type: “phrasal”,
character: “Dziadek”,
situation: “Dziadek mówi, żebyś założył czapkę: ‘It’s cold! ___ your hat.'”,
question: “Wybierz czasownik:”,
options: [“Put on”, “Take off”, “Try on”, “Get on”],
correct: “Put on”,
hint: “‘Put on’ to zakładać ubranie.”
}
];
const App = () => {
const [currentIdx, setCurrentIdx] = useState(0);
const [selectedOption, setSelectedOption] = useState(null);
const [isAnswered, setIsAnswered] = useState(false);
const [score, setScore] = useState(0);
const [showSummary, setShowSummary] = useState(false);
const currentTask = examTasks[currentIdx];
const handleAnswer = (option) => {
if (isAnswered) return;
setSelectedOption(option);
setIsAnswered(true);
if (option === currentTask.correct) {
setScore(s => s + 1);
}
};
const nextQuestion = () => {
if (currentIdx < examTasks.length - 1) {
setCurrentIdx(currentIdx + 1);
setSelectedOption(null);
setIsAnswered(false);
} else {
setShowSummary(true);
}
};
const restart = () => {
setCurrentIdx(0);
setSelectedOption(null);
setIsAnswered(false);
setScore(0);
setShowSummary(false);
};
if (showSummary) {
return (
Brawo!
Ukończyłeś rozmowę z dziadkami.
{score} / {examTasks.length}
{score >= 8 ? “Jesteś gotowy na egzamin! 🌟” : “Dobry początek, powtórz jeszcze kilka razy! 📚”}
);
}
return (
{/* Header */}
Egzaminacyjny Warm-up
Rozmowy z Dziadkami
{currentIdx + 1} / {examTasks.length}
{/* Main Card */}
{/* Situation Box */}
{currentTask.character === “Babcia” ? : }
{currentTask.character} mówi:
“{currentTask.situation}”
{currentTask.question}
{/* Options */}
{currentTask.options.map((option) => {
let btnClass = “w-full p-5 rounded-2xl text-left font-semibold transition-all border-2 “;
let icon = null;
if (isAnswered) {
if (option === currentTask.correct) {
btnClass += “bg-green-50 border-green-500 text-green-700”;
icon =
;
} else if (option === selectedOption) {
btnClass += “bg-red-50 border-red-500 text-red-700”;
icon =
;
} else {
btnClass += “bg-slate-50 border-slate-100 text-slate-300 opacity-50”;
}
} else {
btnClass += “bg-white border-slate-100 text-slate-700 hover:border-orange-300 hover:bg-orange-50 active:scale-95”;
}
return (
);
})}
{/* Feedback & Hint */}
{isAnswered && (
Wskazówka:
{currentTask.hint}
)}
{/* Footer Navigation */}
Przytulne powtórki przed Twoim pierwszym ważnym egzaminem! 👵👴
);
};
export default App;