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

Feature survey result to json #81

Merged
merged 6 commits into from Aug 18, 2022

Conversation

ezmegy
Copy link
Contributor

@ezmegy ezmegy commented Aug 12, 2022

Added json serialisation for the SurveyResult

Implements #79
Relevant to #39 and #69

Happy to discuss :)

Peter Megyesi added 6 commits August 12, 2022 18:02
fixes issue with running build_runner after DoubleAnswer was renamed to MultiDouble
- instead of manually overriding operator == and hashCode one by one
Notes:

- IMPORTANT: when adding new Result subclasses, update the _Converter function in step_result.dart accordingly.
The toJson and fromJson functions there output and parse "type" field in order to distinguish between the different subclasses by that (rather than relying on heuristics in the result data field)

- the name of the result propery had to be streamlined in subclasses, e.g. instead of MultiDoubleQuestionResult.results and VideoStepResult.videoResult it's now .result
- and the explicitToJson option had to be added for the generation to work
- instruction, completion and video step results were missing
- implicit cast wrongly returned List<Result> instead List<QuestionResult>
- minor fix in a test + added a new case for SurveyResult level
@Numoy Numoy merged commit 7ee6ed9 into QuickBirdEng:main Aug 18, 2022
adar2378 added a commit to djangoflow/survey_kit that referenced this pull request Aug 18, 2022
@ezmegy ezmegy mentioned this pull request Sep 12, 2022
@ezmegy ezmegy deleted the feature-survey-result-toJson branch September 12, 2022 15:26
@binaryjc
Copy link

binaryjc commented Dec 2, 2022

is the results toJson() function not yet implemented on the released version? is it coming on version 2?

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.

None yet

3 participants