research.package icon indicating copy to clipboard operation
research.package copied to clipboard

Downloadable surveys

Open pmagnuson opened this issue 2 years ago • 2 comments

We are looking into adding this to an existing Flutter app.

  • Really happy that you selected Flutter
  • This looks like a great contribution to the community for serious research.

Has any thought gone into making the surveys a downloadable resource from a server?

  • admins could change the surveys on the fly
  • changes to surveys would not require an app update.

Thanks,

pmagnuson avatar Jun 19 '23 22:06 pmagnuson

Hi @pmagnuson - thanks for your interest in RP.

As for your question, RP supports JSON serialization. All the survey classes (RPTask, RPStep, etc.) all contains the toJson and fromJson methods, making them serializable on the fly. This can be used for downloading a survey from a server.

We use this ourselves in our CARP Studies app, which is an app that can download a study configuration (incl. surveys) and show this to the user.

The app is a little complicated (and not really documented yet), since it relies heavily on the CARP Mobile Sensing Framework. But it basically downloads an RPTask object for each survey and shows it to the user.

bardram avatar Jul 23 '23 07:07 bardram

Note also, that all the RPResult classes has a toJson() method, which allow you to upload the results back to the server (or save it on the phone).

bardram avatar Jul 23 '23 08:07 bardram