Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

[iOS] Add a local schema to building of “answers.json” #231

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

syoung-smallwisdom
Copy link
Collaborator

@syoung-smallwisdom syoung-smallwisdom commented Sep 14, 2023

It's pretty straight-forward to add the schema to the "answers.json" file on iOS. This was already supported as a part of Sage Research and we deprecated it b/c we were going away from data parsing and the researchers wanted timestamps and question text, etc. That model doesn't lend itself well to the flattened table. ¯_(ツ)_/¯

  • Will take slightly longer to add this on Android but thought I'd put this out there as a "hey, this is what I was talking about in today's meeting".
  • For the sake of simplicity, I did not include format for answers that are date/time, url, etc. bc that's a bit more effort to support on Android.

@github-actions
Copy link

github-actions bot commented Sep 14, 2023

Unit Test Results

83 tests   82 ✔️  20s ⏱️
25 suites    0 💤
25 files      1

For more details on these failures, see this check.

Results for commit ea5eb19.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@Erin-Mounts Erin-Mounts left a comment

Choose a reason for hiding this comment

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

looks good

case .array(let value):
return (value.map { "\($0)" }.joined(separator: ","), .string)
default:
return nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems problematic to return nil for types not supported by the flatAnswer() function. Previously if we had a value it would get serialized into the answers file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added "object" (though we don't actually have any currently supported question types that use this answer type).

Currently we do not have any examples but technically its allowed.
Copy link
Collaborator

@nategbrown9 nategbrown9 left a comment

Choose a reason for hiding this comment

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

Looks good.

@syoung-smallwisdom syoung-smallwisdom merged commit 725a128 into main Sep 14, 2023
2 of 4 checks passed
@syoung-smallwisdom syoung-smallwisdom deleted the syoung/add-answers-file branch September 14, 2023 22:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants