From 2da4bb213ee79dd5ffe16d8dfd0ea0af8c5497f3 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Wed, 6 Dec 2023 06:46:40 -0500 Subject: [PATCH] [+] Finalize --- .../VerbalPronunciationExercise.tsx | 41 +++++++------ .../components/VerbalQuestionsExercise.tsx | 61 +++++++++---------- frontend/src/components/VideoExercise.tsx | 12 ++-- .../components/WrittenQuestionExercise.tsx | 13 ++-- .../components/WrittenVocabularyExercise.tsx | 38 +++++++----- frontend/src/logic/CourseData.ts | 29 +++++---- frontend/src/pages/CollabLearning.tsx | 3 +- frontend/src/pages/Lesson.tsx | 6 +- frontend/src/pages/Review.tsx | 2 +- 9 files changed, 107 insertions(+), 98 deletions(-) diff --git a/frontend/src/components/VerbalPronunciationExercise.tsx b/frontend/src/components/VerbalPronunciationExercise.tsx index ec591a9..2214e7d 100644 --- a/frontend/src/components/VerbalPronunciationExercise.tsx +++ b/frontend/src/components/VerbalPronunciationExercise.tsx @@ -17,6 +17,7 @@ export default function VerbalPronunciationExercise({q, chapter, onSubmit}: Verb const [loading, setLoading] = useState(false); const [correct, setCorrect] = useState(""); const [reason, setReason] = useState(""); + const [userAnswer, setUserAnswer] = useState(""); const handleSubmit = () => { if (answered) { @@ -46,7 +47,8 @@ export default function VerbalPronunciationExercise({q, chapter, onSubmit}: Verb const audioFile = new File([blob], "audio.wav", { type: 'audio/wav' }); const text = await speechToText(audioFile); - const aiMark = await getAIMarking(q.question, text.toLowerCase(), "", chapter, language); + setUserAnswer(text); + const aiMark = await getAIMarking(`Please pronounce the following: ${q.question}`, text.toLowerCase(), "", chapter, language); setAnswered(true); setCorrect(aiMark.correct); setReason(aiMark.reason); @@ -73,14 +75,14 @@ export default function VerbalPronunciationExercise({q, chapter, onSubmit}: Verb
{reason}
- -{reason}
- -{reason}
- +{reason}
- -{q.description}
-{q.example}
-Find people fluent in your taget language to Chat!
+Find people fluent in {getLanguage().name} to Chat!
Help them learn a language you know!
Interests