Skip to content

Commit e24518e

Browse files
committed
fix: only show extended label for linear scale questions
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 2e6d797 commit e24518e

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

src/components/Results/ResultsSummary.vue

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,31 +88,31 @@ export default {
8888
computed: {
8989
questionTypeLabel() {
9090
const label = this.answerTypes[this.question.type].label
91-
const labelLowest =
92-
this.question.extraSettings?.optionsLabelLowest
93-
?? t('forms', 'Strongly disagree')
94-
const labelHighest =
95-
this.question.extraSettings?.optionsLabelHighest
96-
?? t('forms', 'Strongly agree')
97-
const optionsLowest =
98-
this.question.extraSettings?.optionsLowest?.toString() ?? '1'
99-
const optionsHighest =
100-
this.question.extraSettings?.optionsHighest?.toString() ?? '5'
101-
102-
if (labelLowest === '' && labelHighest === '') {
103-
return label
104-
}
10591
106-
const descriptionParts = []
107-
if (labelLowest !== '') {
108-
descriptionParts.push(`${optionsLowest}: ${labelLowest}`)
109-
}
110-
if (labelHighest !== '') {
111-
descriptionParts.push(`${optionsHighest}: ${labelHighest}`)
92+
if (this.question.type === 'linearscale') {
93+
const labelLowest =
94+
this.question.extraSettings?.optionsLabelLowest
95+
?? t('forms', 'Strongly disagree')
96+
const labelHighest =
97+
this.question.extraSettings?.optionsLabelHighest
98+
?? t('forms', 'Strongly agree')
99+
const optionsLowest =
100+
this.question.extraSettings?.optionsLowest?.toString() ?? '1'
101+
const optionsHighest =
102+
this.question.extraSettings?.optionsHighest?.toString() ?? '5'
103+
104+
const descriptionParts = []
105+
if (labelLowest !== '') {
106+
descriptionParts.push(`${optionsLowest}: ${labelLowest}`)
107+
}
108+
if (labelHighest !== '') {
109+
descriptionParts.push(`${optionsHighest}: ${labelHighest}`)
110+
}
111+
const description = ` (${descriptionParts.join(', ')})`
112+
return label + description
112113
}
113114
114-
const description = ` (${descriptionParts.join(', ')})`
115-
return label + description
115+
return label
116116
},
117117
118118
// For countable questions like multiple choice and checkboxes

0 commit comments

Comments
 (0)