diff --git a/frontend/src/pages/Review.tsx b/frontend/src/pages/Review.tsx index 3570b68..f269e56 100644 --- a/frontend/src/pages/Review.tsx +++ b/frontend/src/pages/Review.tsx @@ -10,86 +10,80 @@ export default function Review() { const language = getLanguage(getUsername()); const handleReviewLessonClick = (reviewType: string, lesson: string) => { - type Question = { question: string, wordBank: string[], expected: string, type: string, exercise: string }; - let reviewQuestions: Question[] = []; + type WrittenQuestion = { question: string, wordBank: string[], expected: string, type: string, exercise: string }; + type VocabularyQuestion = { question: string, pronunciation: string, definition: string, example: string, type: string, exercise: string }; if (language === "Japanese") { - reviewQuestions = [ - { - question: 'Translate this sentence: 新幹線で東京に行きます.', - wordBank: ['Explore', 'Train', 'Will', 'City', 'I', 'Go', 'Bullet', 'To', 'Tokyo', 'By', 'Mountain'], - expected: 'I will go to Tokyo by bullet train.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: 空港で荷物を受け取ります.', - wordBank: ['Sunset', 'Will', 'Ocean', 'At', 'Adventure', 'Airport', 'The', 'I', 'Receive', 'Luggage'], - expected: 'I will receive luggage at the airport.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: ホテルでチェックインします.', - wordBank: ['Culture', 'At', 'Jungle', 'Will', 'The', 'Check-In', 'Hotel', 'I', 'Historic'], - expected: 'I will check in at the hotel.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: 観光名所を訪れます.', - wordBank: ['Desert', 'Mountain', 'Beach', 'Visit', 'Attractions', 'Tourist', 'I', 'Will'], - expected: 'I will visit tourist attractions.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: 美味しい地元の食べ物を試します.', - wordBank: ['Try', 'Market', 'Delicious', 'I', 'Food', 'Will', 'River', 'Local', 'Park'], - expected: 'I will try delicious local food.', - type: reviewType, - exercise: lesson - }, - ] - } else if (language === "Mandarin Chinese") { - reviewQuestions = [ - { - question: 'Translate this sentence: 新幹線で東京に行きます.', - wordBank: ['探索', '列車', '意志', '都市', '私', '行く', '弾丸', 'へ', '東京', 'に', '山'], - expected: 'I will go to Tokyo by bullet train.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: 空港で荷物を受け取ります.', - wordBank: ['夕日', '意志', '海洋', 'で', '冒険', '空港', 'の', '私', '受け取る', '荷物'], - expected: 'I will receive luggage at the airport.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: ホテルでチェックインします.', - wordBank: ['文化', 'で', 'ジャングル', '意志', 'の', 'チェックイン', 'ホテル', '私', '歴史的'], - expected: 'I will check in at the hotel.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: 観光名所を訪れます.', - wordBank: ['砂漠', '山', 'ビーチ', '訪れる', '名所', '観光客', '私', '意志'], - expected: 'I will visit tourist attractions.', - type: reviewType, - exercise: lesson - }, - { - question: 'Translate this sentence: 美味しい地元の食べ物を試します.', - wordBank: ['試す', '市場', '美味しい', '私', '食べ物', '意志', '川', '地元', '公園'], - expected: 'I will try delicious local food.', - type: reviewType, - exercise: lesson - }, - ] + if (reviewType === "written" && lesson === "questions") { + let reviewQuestions: WrittenQuestion[] = []; + reviewQuestions = [ + { + question: 'Translate this sentence: 新幹線で東京に行きます.', + wordBank: ['Explore', 'Train', 'Will', 'City', 'I', 'Go', 'Bullet', 'To', 'Tokyo', 'By', 'Mountain'], + expected: 'I will go to Tokyo by bullet train.', + type: reviewType, + exercise: lesson + }, + { + question: 'Translate this sentence: 空港で荷物を受け取ります.', + wordBank: ['Sunset', 'Will', 'Ocean', 'At', 'Adventure', 'Airport', 'The', 'I', 'Receive', 'Luggage'], + expected: 'I will receive luggage at the airport.', + type: reviewType, + exercise: lesson + }, + { + question: 'Translate this sentence: ホテルでチェックインします.', + wordBank: ['Culture', 'At', 'Jungle', 'Will', 'The', 'Check-In', 'Hotel', 'I', 'Historic'], + expected: 'I will check in at the hotel.', + type: reviewType, + exercise: lesson + }, + { + question: 'Translate this sentence: 観光名所を訪れます.', + wordBank: ['Desert', 'Mountain', 'Beach', 'Visit', 'Attractions', 'Tourist', 'I', 'Will'], + expected: 'I will visit tourist attractions.', + type: reviewType, + exercise: lesson + }, + { + question: 'Translate this sentence: 美味しい地元の食べ物を試します.', + wordBank: ['Try', 'Market', 'Delicious', 'I', 'Food', 'Will', 'River', 'Local', 'Park'], + expected: 'I will try delicious local food.', + type: reviewType, + exercise: lesson + }, + ] + navigate('/lesson', { state: { questions: reviewQuestions } }); + } else if (reviewType === "written" && lesson === "vocabulary") { + let reviewQuestions: VocabularyQuestion[] = []; + reviewQuestions = [ + { + question: '飛行機', + pronunciation: 'ひこうき (Hikouki)', + definition: '飛行機 (Hikouki) is the Japanese word for airplane. It refers to a powered flying vehicle with fixed wings and a weight greater than that of the air it displaces.', + example: '飛行機で旅行します。 (I will travel by airplane.)', + type: 'written', + exercise: 'vocabulary', + }, + { + question: '観光', + pronunciation: 'かんこう (Kankou)', + definition: '観光 (Kankou) is the Japanese word for sightseeing. It refers to the activity of visiting places of interest in a particular location, typically as part of a vacation.', + example: '観光地を訪れます。 (I will visit tourist attractions.)', + type: 'written', + exercise: 'vocabulary', + }, + { + question: '予約', + pronunciation: 'よやく (Yoyaku)', + definition: '予約 (Yoyaku) is the Japanese word for reservation. It refers to an arrangement for a seat, room, etc. to be kept for a customer at a restaurant, hotel, or other place.', + example: 'ホテルを予約します。 (I will make a hotel reservation.)', + type: 'written', + exercise: 'vocabulary', + }, + ]; + navigate('/lesson', { state: { questions: reviewQuestions } }); + } } - navigate('/lesson', { state: { questions: reviewQuestions } }); } return ( @@ -112,8 +106,8 @@ export default function Review() { {verbalReview.map(lesson => (