feat(listening): interactive listening comprehension trainer with neural voiceover and auto-evaluation
This commit is contained in:
1 parent
a6fb4349e9
commit
7893b353aa
8 files changed
+1026
-3
No files matched your search
@@ -183,6 +183,29 @@ export const api = {
|
||||
}
|
||||
},
|
||||
|
||||
// Listening Comprehension Trainer
|
||||
listening: {
|
||||
async getExercise(topic = 'all', level = 'B1') {
|
||||
const resp = await fetch(`/api/listening/exercise?topic=${encodeURIComponent(topic)}&level=${encodeURIComponent(level)}`);
|
||||
if (resp.ok) return await resp.json();
|
||||
throw new Error(`Failed to load listening exercise: ${resp.status}`);
|
||||
},
|
||||
async checkAnswer(scenarioId, userAnswer, story = '', idealAnswer = '') {
|
||||
const resp = await fetch('/api/listening/check', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
scenario_id: scenarioId,
|
||||
user_answer: userAnswer,
|
||||
story: story,
|
||||
ideal_answer: idealAnswer
|
||||
})
|
||||
});
|
||||
if (resp.ok) return await resp.json();
|
||||
throw new Error(`Failed to check listening answer: ${resp.status}`);
|
||||
}
|
||||
},
|
||||
|
||||
// Bookshelf & Reader
|
||||
books: {
|
||||
async getAll() {
|
||||
|
||||
Reference in new issue
Block a user