{/* Header */}
Unit 5: Reading Task
{showResults && (
)}
{/* Main Split View */}
Unit 5: Reading Task
Przeczytaj tekst i odpowiedz na pytania obok.
Twój wynik
{calculateScore()} / {questions.length}
{/* Left Column: Text */}
{/* Right Column: Questions */}
{readingText.title}
{readingText.content.map((para, i) => (
{para}
))}
{questions.map((q) => (
))}
{q.q}
{q.options.map((opt) => {
const isSelected = answers[q.id] === opt.id;
const isCorrect = opt.id === q.correct;
let btnClass = “w-full text-left p-4 rounded-xl border-2 transition-all flex justify-between items-center “;
if (!showResults) {
btnClass += isSelected
? “border-indigo-600 bg-indigo-50 text-indigo-700 font-medium”
: “border-slate-100 hover:border-indigo-200 hover:bg-slate-50 text-slate-600”;
} else {
if (isCorrect) {
btnClass += “border-green-500 bg-green-50 text-green-700 font-medium”;
} else if (isSelected && !isCorrect) {
btnClass += “border-red-400 bg-red-50 text-red-700”;
} else {
btnClass += “border-slate-100 opacity-50 grayscale-[0.5]”;
}
}
return (
);
})}
{!showResults ? (
) : (
)}
Zadanie zakończone!
Twój wynik to {calculateScore()} na {questions.length} możliwych.
{/* Header */}
{showResults && (
{calculateScore()} / {questions.length}
)}
{/* Main Split Content */}
Joy’s Holiday Diary
Reading Comprehension
{/* Left: Diary Text */}
{/* Right: Exercises */}
{diaryEntries.map((entry, i) => (
))}
{entry.date}
“{entry.text}”
Example: Where does Joy usually go on holiday?
Answer: She usually goes to Spain.
{questions.map((q) => {
const correct = isCorrect(q);
return (
);
})}
handleInput(q.id, e.target.value)}
className={`w-full p-4 rounded-2xl border-2 outline-none transition-all ${
showResults
? (correct ? “border-emerald-500 bg-emerald-50 text-emerald-800” : “border-red-300 bg-red-50 text-red-800”)
: “border-slate-100 focus:border-emerald-400 bg-slate-50”
}`}
/>
{showResults && (
{showResults && !correct && (
{correct ? : }
)}
Sugestia: {q.correctDesc}
)}
{!showResults ? (
) : (
)}
Zadanie zakończone!
Przejrzyj swoje odpowiedzi powyżej.