Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/components/Results/ResultsSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,31 @@ export default {
computed: {
questionTypeLabel() {
const label = this.answerTypes[this.question.type].label
const labelLowest =
this.question.extraSettings?.optionsLabelLowest
?? t('forms', 'Strongly disagree')
const labelHighest =
this.question.extraSettings?.optionsLabelHighest
?? t('forms', 'Strongly agree')
const optionsLowest =
this.question.extraSettings?.optionsLowest?.toString() ?? '1'
const optionsHighest =
this.question.extraSettings?.optionsHighest?.toString() ?? '5'

if (labelLowest === '' && labelHighest === '') {
return label
}

const descriptionParts = []
if (labelLowest !== '') {
descriptionParts.push(`${optionsLowest}: ${labelLowest}`)
}
if (labelHighest !== '') {
descriptionParts.push(`${optionsHighest}: ${labelHighest}`)
if (this.question.type === 'linearscale') {
const labelLowest =
this.question.extraSettings?.optionsLabelLowest
?? t('forms', 'Strongly disagree')
const labelHighest =
this.question.extraSettings?.optionsLabelHighest
?? t('forms', 'Strongly agree')
const optionsLowest =
this.question.extraSettings?.optionsLowest?.toString() ?? '1'
const optionsHighest =
this.question.extraSettings?.optionsHighest?.toString() ?? '5'

const descriptionParts = []
if (labelLowest !== '') {
descriptionParts.push(`${optionsLowest}: ${labelLowest}`)
}
if (labelHighest !== '') {
descriptionParts.push(`${optionsHighest}: ${labelHighest}`)
}
const description = ` (${descriptionParts.join(', ')})`
return label + description
}

const description = ` (${descriptionParts.join(', ')})`
return label + description
return label
},

// For countable questions like multiple choice and checkboxes
Expand Down