Welcome to the LimeSurvey Community Forum

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

Load saved state without opening the correct survey first

  • stefan_o
  • stefan_o's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258365 by stefan_o
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.5+230214
Own server or LimeSurvey hosting: Own server
Survey theme/template: default (?)
==================
Is it possible to allow participants to save the current state of the survey and reload the state *without* previously opening the correct survey?

Issue is the following: There are multiple cascaded surveys (the last page of survey 1 will redirect them to survey 2 and so on), the reason for that is that there are different start surveys for different groups of people, but the last survey is the same for all.
The problem with that is: A participant is inside survey 2 and saves the state. He later clicks the link again he received (which will lead him to survey 1) and enters his data, he'll get an error message that there is no saved state.
What I would want that he gets redirected to the correct survey and the state is loaded. Is that possible somehow?

Best regards
Stefan

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258377 by DenisChenu
Clearly not possible, even with hacked or plugin : it's better to use another system than save.
Maybe token is the best way

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • stefan_o
  • stefan_o's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258388 by stefan_o
How would token work? The surveys are anonymous and that should be obvious for the participants. So sending participants individual tokens/links in advance is not an option.
Is there an option to generate a link/token during the survey? If you click on save it says "to continue the survey at a later point, use this link: <link> (save it to your bookmarks)". With the option to send the link via email. This would be the better option compared to username/password.

Why would hacking not be possible? I don't like that solution, because it makes updating really difficult. One could a dd another table to the database that stores the usernames and the survey ids. When a survey is saved it is checked that the username is not already in that table and then saved with the survey id. When loading a state, in case it does not match the survey, the table is checked, the correct survey is loaded and then the state is loaded. I did not yet look at source code of LimeSurvey, but depending on the software design that could need a lot modifications.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258390 by DenisChenu
Your proposed solution didn't use default save: yes, it can be done in plugin.

Or create a token on the fly when enter the survey and (in a plugin too) : follow up to 2nd survey if 21st survey is done.

Time to construct such plugin , but can be done.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • stefan_o
  • stefan_o's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 2 weeks ago #258392 by stefan_o
What are you referring to? My first idea or the second one?

As I have never written any plug-in for LimeSurvey (but quite a few for WordPress) I don't really know where to start. I had a look through the docs, it says "Plugins should only extend LimeSurvey via its "public" API.", is the API documented somewhere? Is there some plug-in I could use as start for what I want to do?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago #258398 by tpartner

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.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 month 2 weeks ago - 1 month 2 weeks ago #258409 by DenisChenu

What are you referring to? My first idea or the second one?

This part :

> One could a dd another table to the database that stores the usernames and the survey ids. When a survey is saved it is checked that the username is not already in that table and then saved with the survey id. When loading a state, in case it does not match the survey, the table is checked, the correct survey is loaded and then the state is loaded. I did not yet look at source code of LimeSurvey, but depending on the software design that could need a lot modifications.

As I have never written any plug-in for LimeSurvey (but quite a few for WordPress) I don't really know where to start. I had a look through the docs, it says "Plugins should only extend LimeSurvey via its "public" API.", is the API documented somewhere? Is there some plug-in I could use as start for what I want to do?


 
A lot of sample : gitlab.com/SondagesPro/

LimeSurvey plugin are based on event, where you can do what you want or follow event guidelines (for return part)

Else : here : i think you need to use
- beforeSurveyPage (to check if loadname are in link, and this link are for this survey)
- beforeRegister (yes before …) to use your own save system

If you use only Limesurvey plugin API : you can not construct plugins … use Yii

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 1 month 2 weeks ago by DenisChenu.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose