Welcome to the LimeSurvey Community Forum

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

Add Opt Out Link to Survey pages when survey is anonymous

  • f1refly
  • f1refly's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #142204 by f1refly
I have a public anonymous survey with registration.

On each survey page, I would like to include a link for the participant to opt-out.

I have added the link to the template in startpage.pstpl as "<a href={URL}"/surveys/index.php/optout/tokens/"{SID}"?langcode=en&token="{TOKEN}>Click here to Opt Out of this survey at any time.</a>"

It works except for the {TOKEN}. I'm guessing this is because the survey is anonymous.

Can this be done? Is the TOKEN available in a session variable or anywhere else? I'm thinking it must be somewhere for it to be possible for the system to mark the survey complete in the token table.

Thanks for any advice.
The topic has been locked.
More
7 years 6 months ago #142205 by jelo

f1refly wrote: It works except for the {TOKEN}. I'm guessing this is because the survey is anonymous.

Yes, that's the current situation.

Expression Manager provides read-only access to whichever variables we might need. For backwards compatibility, it provides access to the following:

TOKEN:xxx - the value of a TOKEN (e.g. TOKEN:FIRSTNAME, TOKEN:ATTRIBUTE_5) (Only for NOT anonymous survey).

manual.limesurvey.org/Expression_Manager#Access_to_Variables

The survey designer won't be able to access token variables during the interview to ensure that no token related information find the way into the results.

There were many threads over the years. I've seen to sign so far that LimeSurvey developers have changed their mind about this code-design decision. The typical workaround is to use the URL to get some variables into the interview. But that's not suitable for the token data since it would be saved into the survey results. Which would make no difference than using a non-anonymous survey in the first place.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: f1refly
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose