Skip to content
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

Grouped survey stats #2408

Merged
merged 6 commits into from
Sep 4, 2024
Merged

Grouped survey stats #2408

merged 6 commits into from
Sep 4, 2024

Conversation

schuyler1d
Copy link
Collaborator

@schuyler1d schuyler1d commented Jul 30, 2024

Description

Requested by Jim N (I can't find his Github account) -- This supports two groups of pie chart reports for survey/questions.

  1. If multiple questions have text surrounded by []s that is the same, then those question's answers will be grouped together at the top with a title of "Grouped Questions with [question text]"
    • example: question 1 = [Will you signup?] w/ answers "Yes", "No" and "Not sure" with a Not sure response nagging again and then asking [Will you signup?] really? and then "Yes" "No", then those questions and their "Yes"s and "No"s will be grouped into a single question and the "Not sure" will be added in-tandem (this makes the pie-chart a bit of a lie, if one of the answers leads to follow-on answers)
  2. Furthermore, and separately, if multiple answers have text surrounded by []s that are the same, then those answers will be grouped all together.
    • example: Question 1 = "Will you sign up?" w/ answers [Yes] and [No] and a later question also has answers [Yes] and [No] (or just one of those), then all of those will be grouped into "Responses Grouped by Answers (with []'s)" -- and a single pie chart will have an aswer [Yes] that is all the answers with [Yes] in them combined.

Finally, button text will also work if you make it .e.g "[Yes] I like it" => "Yes" just like "Yes: I like it" would do so before. This makes it easier for buttons across questions to map to the grouped answer values in (2).

I'd like feedback on this feature before adding documentation to make sure one or the other or both features are what's desired and that it can work.

Checklist:

  • I have manually tested my changes on desktop and mobile
  • The test suite passes locally with my changes
  • If my change is a UI change, I have attached a screenshot to the description section of this pull request
  • My change is 300 lines of code or less, or has a documented reason in the description why it’s longer
  • I have made any necessary changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • My PR is labeled [WIP] if it is in progress

spoke_surveysgrouped

@engelhartrueben
Copy link
Collaborator

@electiondaze

@schuyler1d
Copy link
Collaborator Author

At @electiondaze 's request I have implemented this with grouping the sections and default-collapsing the main survey section when grouped responses exist. See screenshot.
spoke-collapsiblestats

@engelhartrueben
Copy link
Collaborator

Hi Sky, two things here that need addressing and then I can approve for staging!

When first opening the campaign stats page, the Pie charts are super large and don't change size until the drop down is closed and reopened again.

chrome_2IefU0eyKX.mp4

The children PropTypes are failing in CollapsibleCard with the error drop down due to this string being passed in the second index. This looks like an issue with how we store error codes in the props.
image

@schuyler1d
Copy link
Collaborator Author

@engelhartrueben latest commit should fix those issues. I couldn't figure out how to make the pie charts perfectly the same size, but they are at least not enormous now.We can bump the 50% to smaller still if you like, but it might mess up surveys with very many options

Copy link
Collaborator

@engelhartrueben engelhartrueben left a comment

Choose a reason for hiding this comment

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

🎉

@engelhartrueben engelhartrueben changed the base branch from main to stage-main-14.1 September 4, 2024 14:06
@engelhartrueben engelhartrueben merged commit 89fcd2e into stage-main-14.1 Sep 4, 2024
17 checks passed
@engelhartrueben engelhartrueben deleted the group-survey branch September 4, 2024 14:09
@mau11 mau11 mentioned this pull request Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 14.1
Development

Successfully merging this pull request may close these issues.

3 participants