Skip to content

feat: add linear scale questions #2609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged

feat: add linear scale questions #2609

merged 1 commit into from
Apr 28, 2025

Conversation

Chartman123
Copy link
Collaborator

@Chartman123 Chartman123 commented Feb 28, 2025

This is a first attempt to implement a new question type. It will close #2605

Current state of implementation:

Edit labels:
grafik

Edit min/max option in context menu:
grafik

Submit view:
grafik

Results view:
image

----- Mobile -----
Submit view:
grafik

Edit view:
grafik

@Chartman123 Chartman123 added this to the 5.1 milestone Feb 28, 2025
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 43.72%. Comparing base (e88ba60) to head (d1975dc).
Report is 22 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2609      +/-   ##
============================================
+ Coverage     43.55%   43.72%   +0.16%     
- Complexity      908      921      +13     
============================================
  Files            78       78              
  Lines          3391     3403      +12     
============================================
+ Hits           1477     1488      +11     
- Misses         1914     1915       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch 2 times, most recently from 7a44578 to 93dd29b Compare March 11, 2025 15:58
@susnux
Copy link
Collaborator

susnux commented Mar 12, 2025

I also saw this sometimes with labels for each option like:

strongly agree    agree    neutral   disagree     strongly disagree
    [ ]            [ ]       [ ]       [ ]               [ ]

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from a0015cd to b1f8f51 Compare March 12, 2025 10:40
@Chartman123
Copy link
Collaborator Author

I also saw this sometimes with labels for each option like:

strongly agree    agree    neutral   disagree     strongly disagree
    [ ]            [ ]       [ ]           [ ]            [ ]

Yes, there are different implementations. I used Google Forms as a "template", Microsoft does it more like in your comment.

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from b1f8f51 to 7db54c5 Compare March 12, 2025 10:42
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! So as defaults, we could set a scale of 1 to 5, since that is what the usual Likert scale is as well.
The labels we could also set to a default of "Strongly disagree" for lowest and "Strongly agree" for the highest, as @susnux mentions – probably best to leave out the other labels, except if we default to those as labels and don’t allow customization. (Or we do an either/or: Either you get numbers, or you get labels.)

Google Forms defaults to 1 for lowest and 5 for highest, and allows only 0 or 1 for lowest as well as only 2 to 10 for highest, which makes sense.

@nimishavijay
Copy link
Member

Awesome! Looks great already!

For reference this is what Google Forms does, but I actually love how we can see the scale in your screenshot
image

Here are some ideas to improve the look of this

  • Since the lowest and highest value is an important attribute of the question, we can move it outside to below the scale
  • Maybe the scale can be a more direct "preview". What would the scale look like in view mode? Could that be replicated here?
  • The labels for the lowest and highest value can also be outside using the inputs with the floating label, what do you think?

Then with the preview it would be like:

             1    2    3    4    5
not so good [ ]  [ ]  [ ]  [ ]  [ ] very good

Lowest value  [ 1 ] [ not so good  ]
Highest value [ 5 ] [ very good    ]

What do you think?

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from 7fe3884 to 7529130 Compare March 12, 2025 10:51
@Chartman123
Copy link
Collaborator Author

Maybe the scale can be a more direct "preview". What would the scale look like in view mode? Could that be replicated here?

@nimishavijay The scale in the edit mode adjusts directly to the changed values in the actions menu and it will look the same in edit and view mode :)

Since the lowest and highest value is an important attribute of the question, we can move it outside to below the scale
The labels for the lowest and highest value can also be outside using the inputs with the floating label, what do you think?

You mean to move the settings from the menu directly to the content of the question? This would be feasible, but also break the UX regarding where to configure the settings of the questions.

Google Forms defaults to 1 for lowest and 5 for highest, and allows only 0 or 1 for lowest as well as only 2 to 10 for highest, which makes sense.

@jancborchardt those are also the defaults for us here :)

probably best to leave out the other labels, except if we default to those as labels and don’t allow customization. (Or we do an either/or: Either you get numbers, or you get labels.)

Google allows to customize all labels for matrix questions. So for that use case you could then use a matrix question with just one row.

@nimishavijay
Copy link
Member

The scale in the edit mode adjusts directly to the changed values in the actions menu and it will look the same in edit and view mode :)

Oh nice! Do you think they can be radio buttons like in Google forms then? I took a quick look at general likert scale forms in other software and radio buttons seems to ne the general standard.

You mean to move the settings from the menu directly to the content of the question? This would be feasible, but also break the UX regarding where to configure the settings of the questions.

Yes, I understand. I see this as rather the settings of the options rather than settings of the question itself (eg. Required question, technical question, etc).
The question types so far were simple enough that they didn't need many options up front, but I'd say this is more complex, what do you think?

@Chartman123
Copy link
Collaborator Author

I see this as rather the settings of the options rather than settings of the question itself (eg. Required question, technical question, etc).

I understand that, but this will break with our current philosophy to show the form in edit view in the same way (except for the borders) as it will be in the submit/view mode. I'm not really sure about that.

Do you think they can be radio buttons like in Google forms then? I took a quick look at general likert scale forms in other software and radio buttons seems to ne the general standard.

Yes, sure:

image

But I also quite like the button variant, could be some sort of "unique selling point". 😉

@susnux
Copy link
Collaborator

susnux commented Mar 12, 2025

I understand that, but this will break with our current philosophy to show the form in edit view in the same way (except for the borders) as it will be in the submit/view mode. I'm not really sure about that.

We could make the labels text boxes just like we do for other question types.
And the options could have a + or -

So nothing in the popover menu needed.

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch 2 times, most recently from 285761c to a5d1af7 Compare March 13, 2025 23:00
@Chartman123 Chartman123 requested review from susnux and Koc March 13, 2025 23:01
@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch 2 times, most recently from c585ccd to ca3ddee Compare March 13, 2025 23:27
@Chartman123 Chartman123 marked this pull request as ready for review March 13, 2025 23:32
@Chartman123 Chartman123 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 13, 2025
@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch 3 times, most recently from ed62aaf to f57c6e9 Compare March 14, 2025 09:13
@Chartman123
Copy link
Collaborator Author

@Elsensee would you like to work on the remaining CSS/design issues here?

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch 2 times, most recently from dd0e683 to 78f58c5 Compare April 1, 2025 22:46
@Chartman123 Chartman123 modified the milestones: 5.1, 5.2 Apr 5, 2025
@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from 78f58c5 to 2479c38 Compare April 19, 2025 15:45
@Chartman123
Copy link
Collaborator Author

@nimishavijay I improved the layout on mobile devices :) Probably not the best solution but it works. Do you know someone who could help here? Or do you think we can leave it as it is right now?

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from 652169c to 28be11a Compare April 19, 2025 17:44
@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from 28be11a to 681f7cc Compare April 19, 2025 17:54
@Chartman123 Chartman123 self-assigned this Apr 19, 2025
@nimishavijay
Copy link
Member

Looks good in mobile :) What do you think about moving the fields to next to the associated radio buttons? Like this:

[] 1    [ strongly disagree ]
[] 2
[] 3
[] 4
[] 5    [ strongly agree    ]

If that's not possible then I'd suggest simply adding around 4px spacing above the lowest value label to separate it from the question fields :)

@Chartman123
Copy link
Collaborator Author

@nimishavijay I can try that :) Google shows the labels above and below, that's where I got the inspiration from. But I also like the idea of putting it next to the lowest/highest value

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from 681f7cc to f170ef1 Compare April 21, 2025 18:25
@Chartman123
Copy link
Collaborator Author

@nimishavijay I used the easier way and added a padding-block: var(--default--grid-baseline) to the labels in mobile view both for edit and view mode.

@Chartman123 Chartman123 requested a review from susnux April 21, 2025 18:30
Copy link
Collaborator

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works fine.
But should here not also the label of the highest option be shown? Currently only the lowest is shown:

grafik

@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from f170ef1 to e00ae3b Compare April 25, 2025 11:57
@Chartman123 Chartman123 force-pushed the enh/question-linear-scale branch from e00ae3b to d1975dc Compare April 25, 2025 12:15
@susnux susnux merged commit 2e6d797 into main Apr 28, 2025
54 checks passed
@susnux susnux deleted the enh/question-linear-scale branch April 28, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: ❓ question types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QuestionType] Linear scale
4 participants