How to return from Survey and how to retrieve Results

55 views
Skip to first unread message

Thormgrim

unread,
Jan 21, 2019, 6:26:23 AM1/21/19
to ResearchStack
Hello there,
Can someone give me a heads-up how to catch the finishing survey activity? I.e. how to manage it returning to another activity or view?
And how can I retrieve the Results from said survey? 

Neither Javadoc nor backbone sample app have helped be thus far.

Thanks in advance.

Aldo Israel NA

unread,
Jan 21, 2019, 2:38:43 PM1/21/19
to ResearchStack
It's a complex topic, I already did it (sadly, I can't share the code) but basically you need to create a subclass of org.researchstack.backbone.task.OrderedTask that class deal with the task flow, you can control the next, the previous steps and get the results of each survey.

Read that class and try to understand how it works. If you have more questions feel free to contact me or maybe I can help with your project.
,

John Strickler

unread,
Jan 22, 2019, 10:15:36 AM1/22/19
to ResearchStack
If you are using the skin framework, it appears that this occurs in DataProvider.uploadTaskResult

madhusudhanan s

unread,
Feb 3, 2019, 1:52:40 PM2/3/19
to ResearchStack
Can you please share the code how to retrieve results and use it for my own. Kindly
Message has been deleted

Thormgrim

unread,
Feb 14, 2019, 2:20:00 AM2/14/19
to ResearchStack
I am now using the Backbone part of Researchkit, and this has been really easy to implement. 

For retrieving the results I am currently using
if(requestCode == REQUEST_SURVEY && resultCode == Activity.RESULT_OK){
   
JSONObject res = processSurveyResult((TaskResult) data.getSerializableExtra(ViewTaskActivity.EXTRA_TASK_RESULT));
    System.out.println(res.toString());
}


The processing of the results then happens in the "processSurveyResult" Method.
Reply all
Reply to author
Forward
0 new messages