feat: answer-Feld im Pair-Content-Bündel (für yes_no-Anzeige im Modal)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 21:01:08 +02:00
parent 8f9a48fa5a
commit ccba8902a4

View File

@@ -229,13 +229,13 @@ async function loadPairContent(p) {
async function loadStatement(stmtId, sentencePrefix, linkTable) { async function loadStatement(stmtId, sentencePrefix, linkTable) {
if (!stmtId) return null; if (!stmtId) return null;
const s = (await query( const s = (await query(
`SELECT ${langCols(sentencePrefix)} FROM statements WHERE id = $1`, [stmtId])).rows[0] || {}; `SELECT ${langCols(sentencePrefix)}, answer FROM statements WHERE id = $1`, [stmtId])).rows[0] || {};
const words = (await query( const words = (await query(
`SELECT w.id, w.titel_de, w.titel_en, w.titel_sv `SELECT w.id, w.titel_de, w.titel_en, w.titel_sv
FROM ${linkTable} lw JOIN words w ON w.id = lw.word_id FROM ${linkTable} lw JOIN words w ON w.id = lw.word_id
WHERE lw.statement_id = $1 WHERE lw.statement_id = $1
ORDER BY w.titel_de`, [stmtId])).rows; ORDER BY w.titel_de`, [stmtId])).rows;
return { sentence: s, words }; return { sentence: s, words, answer: s.answer ?? null };
} }
content.positive = await loadStatement(p.positive_statement_id, 'positive_sentence', 'statement_positive_words'); content.positive = await loadStatement(p.positive_statement_id, 'positive_sentence', 'statement_positive_words');