survey_kit icon indicating copy to clipboard operation
survey_kit copied to clipboard

Survey answer access

Open michaelbc opened this issue 2 years ago • 6 comments

Hi,

Can you show me how to access the survey answers with sample code in Dart/Flutter?

Thanks, Mike

michaelbc avatar Sep 23 '21 22:09 michaelbc

Hello,

I've also been struggling to access scale question answers. I want to add them up and display the score on the completion page.

Thank you!

hsattar12 avatar Sep 27 '21 20:09 hsattar12

Sorry for the late response! I will provide better documentation to the answers in the next release.

 onResult: (result) {
   for (var stepResult in result.results) {
         for (var questionResult in stepResult.results) {
           // Here are your question results
         }
       }
}

Normally the questionsResults should only contain one item.

Numoy avatar Oct 11 '21 07:10 Numoy

Hi,

Thanks for your response! Great work on the library.

Is there an easy way to fetch a JSON of the survey questions and responses in onResult?

Thanks, Mike

On Oct 11, 2021, at 12:58 AM, Marvin März @.***> wrote:

Sorry for the late response! I will provide better documentation to the answers in the next release.

onResult: (result) { for (var stepResult in result.results) { for (var questionResult in stepResult.results) { // Here are your question results } } } Normally the questionsResults should only contain one item.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quickbirdstudios/survey_kit/issues/39#issuecomment-939781774, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADJACZM43KTADN2YKQHITUGKKJ3ANCNFSM5EUVE2QQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

michaelbc avatar Oct 11 '21 17:10 michaelbc

Hi,

currently the steps are not part of the result but we will change that in the future. Right now also the results are not serializable out of the box. You need to parse them yourself:

Numoy avatar Oct 20 '21 10:10 Numoy

Hi,

We can access the result when every question is answered? Because we want to continue from the question left when the user enters into the application again.

Thanks.

furkankaradas avatar Jan 21 '22 06:01 furkankaradas

Hi,

I can not see the results in last widget called by CompletionStep function. Are there anything that we need to do to get the result in the last screen?

Thank you

pambasange avatar Apr 12 '22 18:04 pambasange