diff --git a/frontend/public/audio/es_1_1_3.mp3 b/frontend/public/audio/es_1_1_3.mp3 new file mode 100644 index 0000000..b23bb2e Binary files /dev/null and b/frontend/public/audio/es_1_1_3.mp3 differ diff --git a/frontend/public/audio/es_1_2_3.mp3 b/frontend/public/audio/es_1_2_3.mp3 new file mode 100644 index 0000000..ec73b55 Binary files /dev/null and b/frontend/public/audio/es_1_2_3.mp3 differ diff --git a/frontend/public/video/paella.mp4 b/frontend/public/video/paella.mp4 new file mode 100644 index 0000000..aeb57d6 Binary files /dev/null and b/frontend/public/video/paella.mp4 differ diff --git a/frontend/public/video/tequeños.mp4 b/frontend/public/video/tequeños.mp4 new file mode 100644 index 0000000..1e38ed3 Binary files /dev/null and b/frontend/public/video/tequeños.mp4 differ diff --git a/frontend/src/logic/CourseData.ts b/frontend/src/logic/CourseData.ts index d0015e9..d8bdf0d 100644 --- a/frontend/src/logic/CourseData.ts +++ b/frontend/src/logic/CourseData.ts @@ -101,7 +101,7 @@ export const chapters_jp: Chapter[] = [ // question: "Translate this sentence: Water please", // wordBank: ['水', 'を', 'ください', 'おいしい', 'おもい', 'すし', '中', 'です'], question: 'Translate this sentence: 水をください', - wordBank: ['I', 'sushi', 'cookies', 'want', 'please', 'give', 'rice', 'some', 'yesterday'], + wordBank: ['I', 'sushi', 'cookies', 'want', 'please', 'give', 'Water', 'some', 'yesterday'], // expected: '水をください', expected: 'Water please', type: "written-question" @@ -137,3 +137,83 @@ export const chapters_jp: Chapter[] = [ }] } ] + +export const chapters_es: Chapter[] = [ + { + name: 'Order food', + steps: [{ + questions: [ + { + question: "Translate this phrase: Me provoca un helado", + wordBank: ['I', 'want', 'ice cream', 'an', 'urgent', 'am', 'craving', 'milkshake'], + expected: 'I want an ice cream', + type: "written-question" + }, + { + question: 'Pastel', + pronunciation: 'Pastel (pahs-tehl)', + description: 'Pastel is the Spanish word for "cake". It is a popular dessert in many Spanish-speaking countries, also known as torta.', + example: 'Vamos a celebrar con un pastel! (Let\'s celebrate with a cake!)', + type: 'written-vocabulary', + }, + { + question: 'What do you hear?', + wordBank: ['favor', 'ver', 'el', 'menú', 'por', 'favor', 'Quiero', 'libro', 'risas', 'oler'], + expected: 'Quiero ver el menú por favor', + translation: 'I want to see the menu, please', + url: window.location.origin + '/audio/es_1_1_3.mp3', + type: 'verbal-question', + }, + { + question: 'Please say: Este postre es exquisito', + translation: 'This dessert is exquisite', + type: 'verbal-pronunciation', + }, + { + question: 'What is the filling of the tequeño?', + clipUrl: window.location.origin + "/video/paella.mp4", + description: "Tequeños are a popular Venezuelan appetizer. They are made of cheese wrapped in dough and fried.", + expected: 'Cheese (queso)', + type: 'video', + } + ] + }, + { + questions: [ + { + question: "Translate this phrase: Yo quiero agua por favor", + wordBank: ['I', 'juice', 'water', 'want', 'please', 'give', 'some', 'now'], + expected: 'I want water please', + type: "written-question" + }, + { + question: 'Jugo', + pronunciation: 'Jugo (hoo-goh)', + description: 'Jugo is the Spanish word for "juice". In some parts of the world, juice is also called zumo.', + example: 'Me gusta tomar jugo de naranja! (I like to drink orange juice!)', + type: 'written-vocabulary', + }, + { + question: 'What do you hear?', + wordBank: ['Que', 'Quien', 'tomar', 'yo', 'tú', 'quieres', 'comer', 'de'], + expected: 'Que quieres de comer', + translation: 'What do you want to eat?', + url: window.location.origin + '/audio/es_1_2_3.mp3', + type: 'verbal-question', + }, + { + question: 'Please say: La comida está deliciosa!', + translation: 'The food is delicious!', + type: 'verbal-pronunciation', + }, + { + question: 'What is the boy going to eat?', + clipUrl: window.location.origin + "/video/paella.mp4", + description: "The boy is about to eat paella, a traditional Spanish dish. It is made of rice, seafood, and vegetables.", + expected: 'Paella', + type: 'video', + } + ] + }] + } +] \ No newline at end of file diff --git a/frontend/src/logic/sdk.ts b/frontend/src/logic/sdk.ts index 49b7320..7cefcfb 100644 --- a/frontend/src/logic/sdk.ts +++ b/frontend/src/logic/sdk.ts @@ -1,14 +1,16 @@ import MandarinChinese from '../assets/img/lang/zh.svg' import Japanese from '../assets/img/lang/ja.svg' +import Spanish from '../assets/img/lang/es.svg' import English from '../assets/img/lang/en.svg' -import {Chapter, chapters_jp} from "./CourseData"; +import {Chapter, chapters_jp, chapters_es} from "./CourseData"; // db.users: Signup table map // db.user: Current logged-in user const db = localStorage -const backendUrl = 'https://318-bk.hydev.org' +// const backendUrl = 'https://318-bk.hydev.org' +const backendUrl = "https://127.0.0.1:8000" export interface Lang { name: string @@ -20,6 +22,7 @@ export interface Lang { export const possibleLangs: Lang[] = [ // {name: 'Mandarin Chinese', code: 'zh', icon: MandarinChinese, data: []}, {name: 'Japanese', code: 'ja', icon: Japanese, data: chapters_jp}, + {name: 'Spanish', code: 'es', icon: Spanish, data: chapters_es}, // {name: 'English', code: 'en', icon: English, data: []}, ] @@ -30,7 +33,7 @@ export function signup(username: string, password: string, language: string) const users = JSON.parse(db.users) - users[username] = {password, language} + users[username] = {password, language, "experience": 10, "completed_modules": [], "day_streak": 0, "speaking": 0} db.users = JSON.stringify(users) db.user = username diff --git a/frontend/src/pages/Review.tsx b/frontend/src/pages/Review.tsx index 962f35a..ef71058 100644 --- a/frontend/src/pages/Review.tsx +++ b/frontend/src/pages/Review.tsx @@ -12,7 +12,7 @@ export default function Review() { const handleReviewLessonClick = (reviewType: string, lesson: string) => { const lessons: _Question[] = getLanguage().data.flatMap(chapter => chapter.steps).flatMap(step => step.questions); - navigate('/lesson', { state: { questions: lessons.filter(it => it.type == `${reviewType}-${lesson}`), home: location.pathname } }); + navigate('/lesson', { state: { questions: lessons.filter(it => it.type === `${reviewType}-${lesson}`), home: location.pathname } }); } return (