diff --git a/src/components/KnowledgeArea.vue b/src/components/KnowledgeArea.vue index 8434ecf..0eb2b50 100644 --- a/src/components/KnowledgeArea.vue +++ b/src/components/KnowledgeArea.vue @@ -2376,41 +2376,41 @@ const startGame = (subject: string, taskIndex: number) => { case 'math': const mathTasks = ['counting', 'shapes', 'calculation']; taskType = mathTasks[taskIndex] || 'counting'; - gameDataSubject = gameData.math[taskType as keyof typeof gameData.math]; - startIndex = progress.value.math[taskType as keyof typeof progress.value.math] || 0; + gameDataSubject = gameData.math[taskType]; + startIndex = progress.value.math[taskType] || 0; break; case 'chinese': const chineseTasks = ['radicals', 'pinyin', 'words']; taskType = chineseTasks[taskIndex] || 'radicals'; - gameDataSubject = gameData.chinese[taskType as keyof typeof gameData.chinese]; - startIndex = progress.value.chinese[taskType as keyof typeof progress.value.chinese] || 0; + gameDataSubject = gameData.chinese[taskType]; + startIndex = progress.value.chinese[taskType] || 0; break; case 'english': const englishTasks = ['maze', 'animal', 'dialogue']; taskType = englishTasks[taskIndex] || 'maze'; - gameDataSubject = gameData.english[taskType as keyof typeof gameData.english]; - startIndex = progress.value.english[taskType as keyof typeof progress.value.english] || 0; + gameDataSubject = gameData.english[taskType]; + startIndex = progress.value.english[taskType] || 0; break; case 'science': const scienceTasks = ['plants', 'buoyancy', 'colors', 'chemistry', 'physics', 'experiments']; taskType = scienceTasks[taskIndex] || 'plants'; - gameDataSubject = gameData.science[taskType as keyof typeof gameData.science]; - startIndex = progress.value.science[taskType as keyof typeof progress.value.science] || 0; + gameDataSubject = gameData.science[taskType]; + startIndex = progress.value.science[taskType] || 0; break; case 'japanese': const japaneseTasks = ['hiragana', 'animals', 'fruits', 'body', 'directions', 'items', 'greetings']; taskType = japaneseTasks[taskIndex] || 'hiragana'; - gameDataSubject = gameData.japanese[taskType as keyof typeof gameData.japanese]; - startIndex = progress.value.japanese[taskType as keyof typeof progress.value.japanese] || 0; + gameDataSubject = gameData.japanese[taskType]; + startIndex = progress.value.japanese[taskType] || 0; break; case 'geography': const geographyTasks = ['map', 'basics', 'northSouth']; taskType = geographyTasks[taskIndex] || 'map'; - gameDataSubject = gameData.geography[taskType as keyof typeof gameData.geography]; - startIndex = progress.value.geography[taskType as keyof typeof progress.value.geography] || 0; + gameDataSubject = gameData.geography[taskType]; + startIndex = progress.value.geography[taskType] || 0; break; default: - gameDataSubject = gameData[subject as keyof typeof gameData]; + gameDataSubject = gameData[subject]; startIndex = 0; }