improved questionnaire editor glass scales
Some checks failed
PHPUnit / test (push) Has been cancelled
Some checks failed
PHPUnit / test (push) Has been cancelled
This commit is contained in:
@ -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>`;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user