Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Custom function on clear all

More
1 year 3 weeks ago #228278 by ployrich
Your LimeSurvey version: 3.27.14
Own server or LimeSurvey hosting: self hosted
Survey theme/template: custom based on bootswatch
==================
Dear all,

The scenario I am in is: We have a survey which has multiple parts. For all of them we allow the user to exit and clear their data. The out of the box solution obviously only clears the data for the survey part they were in.

What is the best way to trigger a custom function that does a lookup of the other survey parts and calls the api to delete the response?
Using a Plugin? JS/Ajax?

Thanks in advance

Please Log in to join the conversation.

More
1 year 3 weeks ago #228282 by tpartner
Assuming that the surveys are connected via a non-anonymous token, you could fire an AJAX call to a PHP file that uses the API get_response_ids() and delete_response() methods to remove the responses.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose