Skip to content

feat(results): average, median, range and Net Promoter Score for scale questions - #3635

Open
global-prog wants to merge 2 commits into
nextcloud:mainfrom
global-prog:contrib/response-statistics
Open

feat(results): average, median, range and Net Promoter Score for scale questions#3635
global-prog wants to merge 2 commits into
nextcloud:mainfrom
global-prog:contrib/response-statistics

Conversation

@global-prog

Copy link
Copy Markdown

Summary

Scale questions currently show a bar per value, which makes it hard to compare two questions, or two runs of the same form, at a glance.

This adds a small set of figures above the existing bars for linearscale questions:

  • count, average, median, lowest, highest
  • for a 0–10 scale, a Net Promoter Score with its promoter and detractor shares (the usual 9–10 / 7–8 / 0–6 split)

The median sits next to the average deliberately — at the response counts most forms see, one extreme answer moves an average a long way, and showing both makes that visible.

The NPS line only appears when the scale is actually 0–10, since that is the shape those scales are almost always used for.

Scope

Purely additive and presentational:

  • one file changed, src/components/Results/ResultsSummary.vue
  • no API change, no schema change, no migration
  • questions of other types render exactly as before
  • the existing per-value bars are untouched; the figures are shown above them

Testing

  • npm run lint and npm run stylelint clean
  • built against current main (vite --mode production build) with no errors
  • checked with an empty result set (renders nothing), a single response, and a 0–10 scale

Happy to adjust the wording, the choice of figures, or the placement if you would prefer them elsewhere in the summary.

…or scale questions

Scale questions currently show only a bar per value, which makes it hard to compare
two questions or two runs of the same form at a glance.

This adds count, average, median, lowest and highest above the existing bars. The
median is shown next to the average deliberately: at the response counts most forms
see, a single extreme answer moves an average a long way.

A 0-10 scale additionally reports a Net Promoter Score with its promoter and detractor
shares, using the usual 9-10 / 7-8 / 0-6 split, since that is the shape those scales
are almost always used for.

Purely additive and presentational: no API change, no schema change, and questions of
other types are unaffected.

Signed-off-by: global-prog <raqeeb@uosamarra.edu.iq>
@global-prog
global-prog force-pushed the contrib/response-statistics branch from 4f0ebc9 to 6eedc91 Compare September 9, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant