import { useState, useEffect } from 'react'; export default function QuoteAttributionGame() { const [quotes, setQuotes] = useState([ { text: "I am a god.", author: "Kanye", context: "From Kanye's song 'I Am a God' on his 2013 album Yeezus." }, { text: "The Jews are responsible for all the wars in the world.", author: "Neither", context: "This was actually said by Mel Gibson during a 2006 arrest, not by either Hitler or Kanye." }, { text: "I believe that I am acting in accordance with the will of the Almighty Creator.", author: "Hitler", context: "From Hitler's book Mein Kampf, published in 1925." }, { text: "My greatest pain in life is that I will never be able to see myself perform live.", author: "Kanye", context: "Said during a 2013 interview with W Magazine." }, { text: "The stronger must dominate and not mate with the weaker.", author: "Hitler", context: "From Hitler's book Mein Kampf, expressing his views on eugenics." }, { text: "I'm like a vessel, and God has chosen me to be the voice and the connector.", author: "Kanye", context: "Said during a 2016 interview discussing his music and influence." }, { text: "The victor will never be asked if he told the truth.", author: "Hitler", context: "A statement attributed to Hitler regarding propaganda and power." }, { text: "I am Warhol. I am the No. 1 most impactful artist of our generation.", author: "Kanye", context: "Said during a 2013 interview with Sway Calloway." }, { text: "Great liars are also great magicians.", author: "Hitler", context: "A statement attributed to Hitler about the power of deception." }, { text: "I'm going to be the first hip-hop designer and because of that I'm going to be bigger than Walmart.", author: "Kanye", context: "Said during a 2013 interview about his fashion aspirations." } ]); const [currentQuoteIndex, setCurrentQuoteIndex] = useState(0); const [score, setScore] = useState(0); const [showAnswer, setShowAnswer] = useState(false); const [gameOver, setGameOver] = useState(false); const [userAnswer, setUserAnswer] = useState(null); // Shuffle quotes at the beginning useEffect(() => { const shuffledQuotes = [...quotes].sort(() => Math.random() - 0.5); setQuotes(shuffledQuotes); }, []); const handleGuess = (guess) => { setUserAnswer(guess); setShowAnswer(true); if (guess === quotes[currentQuoteIndex].author) { setScore(score + 1); } }; const nextQuestion = () => { setShowAnswer(false); setUserAnswer(null); if (currentQuoteIndex < quotes.length - 1) { setCurrentQuoteIndex(currentQuoteIndex + 1); } else { setGameOver(true); } }; const restartGame = () => { setCurrentQuoteIndex(0); setScore(0); setShowAnswer(false); setGameOver(false); setUserAnswer(null); const shuffledQuotes = [...quotes].sort(() => Math.random() - 0.5); setQuotes(shuffledQuotes); }; return (
Test your knowledge of historical and contemporary figures
"{quotes[currentQuoteIndex].text}"
Who said this?
{userAnswer === quotes[currentQuoteIndex].author ? "Correct!" : `Incorrect. This was said by ${quotes[currentQuoteIndex].author}.`}
{quotes[currentQuoteIndex].context}
Your final score: {score} out of {quotes.length}
Perfect score! You really know your quotes.
) : score >= quotes.length * 0.7 ? (Great job! You have a good knowledge of these figures.
) : score >= quotes.length * 0.5 ? (Not bad! You got half or more correct.
) : (This can be a tricky subject. Keep learning!
)}This quiz is designed for educational purposes to highlight how quotes can be misattributed or taken out of context. Understanding the source and context of statements is crucial for media literacy.