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:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user