Added paths to verbal questions.

This commit is contained in:
juanpabloacosta
2023-11-30 23:32:57 -05:00
parent 4c293e463e
commit b88b0fd1f4
2 changed files with 65 additions and 18 deletions
+11 -3
View File
@@ -4,6 +4,7 @@ import WrittenQuestionExercise from "../components/WrittenQuestionExercise"
import WrittenVocabularyExercise from "../components/WrittenVocabularyExercise"
import VerbalQuestionsExercise from "../components/VerbalQuestionsExercise"
import Progress from '../components/Progress';
import VerbalPronunciationExercise from '../components/VerbalPronunciationExercise';
export default function Lesson() {
const location = useLocation();
@@ -50,7 +51,7 @@ export default function Lesson() {
default:
return null;
}
case 'verbal-listening':
case 'verbal':
switch (question.exercise) {
case 'questions':
return <VerbalQuestionsExercise
@@ -62,8 +63,15 @@ export default function Lesson() {
language={"Japanese"}
onQuestionSubmit={handleQuestionSubmit}
/>;
// case 'pronunciation':
// return <VerbalPronunciationLesson />;
case 'pronunciation':
return <VerbalPronunciationExercise
key={currQuestion}
question={question.question}
expected={question.expected}
chapter={"Travel"}
language={"Japanese"}
onQuestionSubmit={handleQuestionSubmit}
/>;
default:
return null;
}
+54 -15
View File
@@ -13,6 +13,7 @@ export default function Review() {
const handleReviewLessonClick = (reviewType: string, lesson: string) => {
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 };
type VerbalQuestion = { question: string, wordBank: string[], expected: string, type: string, exercise: string };
if (language === "Japanese") {
if (reviewType === "written" && lesson === "questions") {
let reviewQuestions: WrittenQuestion[] = [];
@@ -37,21 +38,7 @@ export default function Review() {
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") {
@@ -83,6 +70,58 @@ export default function Review() {
},
];
navigate('/lesson', { state: { questions: reviewQuestions, home: location.pathname } });
} else if (reviewType === "verbal" && lesson === "questions") {
let reviewQuestions: VerbalQuestion[] = [];
reviewQuestions = [
{
question: '新幹線で東京に行きます.',
wordBank: ['新', '幹', '線', 'で', '東', '京', 'に', '行', 'き', 'ま', 'す'],
expected: '新幹線で東京に行きます.',
type: reviewType,
exercise: lesson
},
{
question: '空港で荷物を受け取ります.',
wordBank: ['空', '港', 'で', '荷', '物', 'を', '受', 'け', '取', 'り', 'ます', '.'],
expected: '空港で荷物を受け取ります.',
type: reviewType,
exercise: lesson
},
{
question: 'ホテルでチェックインします.',
wordBank: ['ホ', 'テ', 'ル', 'で', 'チ', 'ェ', 'ッ', 'ク', 'イ', 'ン', 'し', 'ま', 'す', '.'],
expected: 'ホテルでチェックインします.',
type: reviewType,
exercise: lesson
}
];
navigate('/lesson', { state: { questions: reviewQuestions, home: location.pathname } });
} else if (reviewType === "verbal" && lesson === "pronunciation") {
let reviewQuestions: VerbalQuestion[] = [];
reviewQuestions = [
{
question: '新幹線で東京に行きます.',
wordBank: ['新', '幹', '線', 'で', '東', '京', 'に', '行', 'き', 'ま', 'す'],
expected: '新幹線で東京に行きます.',
type: reviewType,
exercise: lesson
},
{
question: '空港で荷物を受け取ります.',
wordBank: ['空', '港', 'で', '荷', '物', 'を', '受', 'け', '取', 'り', 'ます', '.'],
expected: '空港で荷物を受け取ります.',
type: reviewType,
exercise: lesson
},
{
question: 'ホテルでチェックインします.',
wordBank: ['ホ', 'テ', 'ル', 'で', 'チ', 'ェ', 'ッ', 'ク', 'イ', 'ン', 'し', 'ま', 'す', '.'],
expected: 'ホテルでチェックインします.',
type: reviewType,
exercise: lesson
}
];
navigate('/lesson', { state: { questions: reviewQuestions, home: location.pathname } });
}
}
}