citizenlab
citizenlab copied to clipboard
TAN-1164 - Merge survey result generator with survey response grouper
Changes made to SurveyResultsGeneratorService
SurveyResultsGeneratorService is now called with additional parameters in SurveyQuestionResult
instead of SurveyResponseGrouper
:
service.generate_results(
field_id: question_id,
group_mode: group_mode,
group_field_id: group_field_id
)
To bring the two services together, the following structural changes have been made to the structure of the SurveyResponseGrouper
service:
-
totalResponses
->totalResponseCount
- To be more consistent in naming counts -
questionResponseCount
- Has been added - This is the number of responses that have answered this question -
totalPicks
->totalPickCount
- for consistency in naming -
multilocs->answer->key
now hastitle_multiloc
inserted to allow forimage
to also be added into this data for image question types ie multilocs now looks like this:
multilocs: {
answer: {
cat: { title_multiloc: { en: 'Cat' } },
dog: { title_multiloc: { en: 'Dog' } }
}
}
Changelog
Changed
- Added question numbers to survey results
Technical
- Merged two APIs and changed structure for consistency between all survey results
Warnings | |
---|---|
:warning: | The PR title contains no Jira issue key (case-sensitive) |
:warning: | The branch name contains no Jira issue key (case-sensitive) |
Messages | |
---|---|
:book: | Changelog provided 🎉 |
:book: | |
:book: | Check translation progress |
Generated by :no_entry_sign: dangerJS against 7c36d0ed65fd75c122a0d66789f90ee53ab503da
@luucvanderzee @alexander-cit Sorry meant to share this on Friday for review. Think I've done everything to get the new format working with the existing components. However on the front-end, there is probably some further work that needs to be done to bring to two sets of components/types together. I haven't done this.
I also have another backend branch open off this with a couple of perf improvements I've been playing around with that hopefully I'll have a chance to complete this week, but they're not essential.
I made a PR with some suggestions / extra tests: https://github.com/CitizenLabDotCo/citizenlab/pull/7302/files Will now do a separate review for the FE part