feat(bisaya): enhance speaking prompts and practical tasks for lesson 46

This commit is contained in:
Torsten Schulz (local)
2026-08-27 15:21:40 +02:00
parent 3248579529
commit 13aaf8c0f2
4 changed files with 74 additions and 4 deletions

View File

@@ -645,14 +645,28 @@ function buildSentenceExercise(lessonTitle, pattern) {
}
function buildTaskSentenceExercise(lesson, didactics, pattern) {
const sentenceExercise = buildSentenceExercise(lesson.title, pattern);
if (!sentenceExercise) return null;
const practicalTask = Array.isArray(didactics.practicalTasks) ? didactics.practicalTasks[0] : null;
const speakingPrompt = Array.isArray(didactics.speakingPrompts) ? didactics.speakingPrompts[0] : null;
const taskText = normalizeText(practicalTask?.text || '');
const scenarioCue = normalizeText(speakingPrompt?.cue || '');
// When the transfer task explicitly asks for a chain or scene, build that
// whole cue. Using an unrelated single core pattern makes the UI promise
// something different from the words it offers.
const sentenceTarget = scenarioCue && /drei kurze fragen|fragekette|szene|dialog/i.test(taskText)
? scenarioCue
: pattern;
const sentenceExercise = buildSentenceExercise(lesson.title, sentenceTarget);
if (!sentenceExercise) return null;
return {
...sentenceExercise,
title: `${lesson.title}: Satz aus dem Alltag bauen`,
questionData: {
...sentenceExercise.questionData,
question: sentenceTarget === scenarioCue
? 'Ordne die Wortkarten als drei Fragen: Wohin geht die Person? Wann geht sie los? Mit wem ist sie unterwegs?'
: sentenceExercise.questionData.question
},
instruction: practicalTask?.text
? `Baue die passende Formulierung für diese Aufgabe: ${practicalTask.text}`
: 'Ordne die Wörter zu einem natürlichen Bisaya-Satz aus dem Alltag.'