Survey-library: Saving intermediate results when "Next" is pressed?

Created on 21 Apr 2017  路  5Comments  路  Source: surveyjs/survey-library

Asking a question:

What is the current behavior?

Currently the survey is only saved to the server when the "Complete" button is pressed. But this might result in nothing being saved if the user quits part way through the survey.

What is the expected behavior?

What I would like is for the survey to be [optionally] saved to the server whenever next is submitted - perhaps with an extra flag saying that it is partially completed.

I had a look at the tests in the source and thought maybe the solution is to do something like this...

document.getElementById('surveyNext').onclick = function() { mycodegoeshere(); survey.nextPage(); };

but I am not sure what that should be - and whether this is the best approach.

How would you reproduce the current behavior (if this is a bug)?

  • browser: any
  • browser version:
  • surveyjs platform jquery for me.
  • surveyjs version: latest (as of yesterday :-)

Thanks for all your hard work on this.

question

Most helpful comment

@alexmc6 You have to set survey.sendResultOnPageNext to true and use survey.onPartialSend event.

Thank you,
Andrew

All 5 comments

@alexmc6, hello! You can try onCurrentPageChangedevent:

survey.onCurrentPageChanged.add( mycodegoeshere() );

and we'll think about examples for it

@alexmc6 You have to set survey.sendResultOnPageNext to true and use survey.onPartialSend event.

Thank you,
Andrew

THANKS!
(Sorry I missed that)

I understand that onPartialSend is a feature for large survey. However, it is possible only send the "current" page result?
I have gone though the methods in survey model. I can't find suitable methods. Am I missing sth?

@gstkenpo Please call survey.sendResult method

Thank you,
Andrew

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wollerman picture wollerman  路  4Comments

alexmc6 picture alexmc6  路  3Comments

AWIXOR picture AWIXOR  路  3Comments

dmitrykurmanov picture dmitrykurmanov  路  3Comments

madceb picture madceb  路  3Comments