Welcome to the LimeSurvey Community Forum

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

Personal time limitation on token links

  • Jenncr93
  • Jenncr93's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 2 months ago #233822 by Jenncr93
Personal time limitation on token links was created by Jenncr93
LimeSurvey version: 3.28.13
Server: University server

Hello, I am building a survey using token-based response persistence to evaluate an online platform at three time points (T0=before using the platform, T1=2weeks and T2=8 weeks). Since we do not know the participants, those who sign up to the platform will receive the survey link to register in the welcome email and then will receive the survey link in their emails. Since we need participants to fill in the questionnaire before using the platform or at least shortly after (max 48h), one of the problems we encounter is making sure that they fill out the questionnaire maximum 48h after registering on the survey, that is, after receiving the link with their token, to have a valid time zero.

I have looked and have not found a solution other than making ALL tokens valid until a certain time or going participant by participant changing their time limitation. 

My question is: Is there a way to automatically make each token-link valid for only 48h after its generation? 

Thank you so much for any suggestion you can provide!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago - 2 years 2 months ago #233824 by Joffm
Replied by Joffm on topic Personal time limitation on token links
Hi,
one idea:
In the registration email remove the placeholder {SURVEYURL} and replace by 
<a href=" www.myServer.com/limesurvey/index.php/{SID }?token={TOKEN}&P1={time()}">Click for Survey</a>
This blue part is the survey URL you see in the "Survey Summary"( here with the placeholder {SID} that is automatically replaced by the actual surveyID.
You add the token manually AND a parameter with the actual timestamp.

In the survey you capture this parameter and compare with the actual timestamp.
If the difference is greater than 48h, screen out the respondent.

Joffm

But "University Server"?
Could be an obstacle if you have no rights to edit the email template.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 2 months ago by Joffm.

Please Log in to join the conversation.

  • Jenncr93
  • Jenncr93's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 2 months ago #233825 by Jenncr93
Replied by Jenncr93 on topic Personal time limitation on token links
Thank you so much Jeffm!! Fortunately, I do have access to the email template despite being the university server (I don’t have access to the actual survey template though). I will give this a try and validate if it works!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago - 2 years 2 months ago #233827 by Joffm
Replied by Joffm on topic Personal time limitation on token links
Just to add:
This is what I get.
You see it is fine despite the curly bracket at the end (copy/paste error)
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 2 months ago by Joffm.

Please Log in to join the conversation.

  • Jenncr93
  • Jenncr93's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 2 months ago #233992 by Jenncr93
Replied by Jenncr93 on topic Personal time limitation on token links
Hello Joffm,

I apologize for the late follow up. I was able to replace the placeholder in the email template. However, I am having trouble following the instructions for the parameter. Can you please specify the steps that I need to follow to create the parameter that will capture the actual timestamp?

Thank you so much!!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago #233999 by Joffm
Replied by Joffm on topic Personal time limitation on token links
What is your problem?
How to capture this parameter P1?
Easy: Create a question of type "short text" with code "P1"
Read the manual, where it is explained
[url] www.limesurvey.org/manual/URL_fields/en#Start_URL [/url]

Or you use "Panel Integration", though not really necessary here.
[url] www.limesurvey.org/manual/Panel_integration/en [/url]

Now you have the timestamp of your invitation.
In a question of type "equation" you calculate the difference between this value and the actual time.
{time()-P1}
Because timestamps measure in seconds you have to divide by 3600 to get the hours.
Here you find all functions you may use.
[url] www.limesurvey.org/manual/ExpressionScri...mplemented_functions [/url]

If you have further question, show us your tries.
Provide a lss export of the relevant questions.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose