improved questionnaire editor glass scales
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-06-06 16:28:10 +02:00
parent d68b2b267d
commit e5ae48c02e
7 changed files with 388 additions and 30 deletions

View File

@ -270,6 +270,12 @@ function visibleQuestionIndices(questions, sectionByIdx) {
return visible;
}
function symptomRowLabel(q, symptomKey) {
const rows = q.glassSymptoms || [];
const row = rows.find(r => r.key === symptomKey);
return (row?.labelDe || '').trim() || symptomKey;
}
function renderQuestionBody(q, sectionIdx) {
const layout = q.type || '';
const config = parseConfig(q);
@ -382,7 +388,7 @@ function renderQuestionBody(q, sectionIdx) {
for (const so of scaleOpts) inner += `<th>${esc(so.label)}</th>`;
inner += `</tr></thead><tbody>`;
symptoms.forEach((sym, si) => {
inner += `<tr><td>${esc(sym)}</td>`;
inner += `<tr><td>${esc(symptomRowLabel(q, sym))}</td>`;
scaleOpts.forEach(so => {
inner += `<td><input type="radio" name="${prefix}_g_${si}" data-symptom="${esc(sym)}" value="${esc(so.key)}"></td>`;
});