- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Date problem - find number of days since last survey
- Maris
- Topic Author
- Offline
- New Member
Less
More
9 years 3 months ago #115440
by Maris
Date problem - find number of days since last survey was created by Maris
Hi folks.
I'm new to Lime Survey, reading the manual cover-to-cover, but I haven't found a way to do one seemingly innocuous thing.
What I am trying to do is measure the number of days between the day that a person comes to a survey, "today", and the previous day that person did the same survey, "previous".
"today" - "previous" = number of days elapsed.
Should be easy, right?
But HOW on Earth do you find the date a person has completed a survey previously?
I've looked at Tokens, and I might be able to put in a special field for date created, for their initial visit.
But how would I find the difference in days between visit 3 and visit 2, for example.
I guess one thing I need to find out is "Is there a date associated with when a survey is submitted?" "If there is, is there a way to access that information in the build of the survey?"
I'm all adrift here. Please let me know if the situation is unclear or you need more information?
Things you may need to know -
We are following people over time.
They will have the same questions every visit.
We want to know how long it has been since their last survey visit.
I'm new to Lime Survey, reading the manual cover-to-cover, but I haven't found a way to do one seemingly innocuous thing.
What I am trying to do is measure the number of days between the day that a person comes to a survey, "today", and the previous day that person did the same survey, "previous".
"today" - "previous" = number of days elapsed.
Should be easy, right?
But HOW on Earth do you find the date a person has completed a survey previously?
I've looked at Tokens, and I might be able to put in a special field for date created, for their initial visit.
But how would I find the difference in days between visit 3 and visit 2, for example.
I guess one thing I need to find out is "Is there a date associated with when a survey is submitted?" "If there is, is there a way to access that information in the build of the survey?"
I'm all adrift here. Please let me know if the situation is unclear or you need more information?
Things you may need to know -
We are following people over time.
They will have the same questions every visit.
We want to know how long it has been since their last survey visit.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
9 years 3 months ago #115441
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Date problem - find number of days since last survey
I don't think that there is any way to get this out of the box in Limesurvey, due to the way that Limesurvey is built.
In the data file you can save the date for each filled questionnaire. But you can't access this information in another questionnaire I think. You can only get this later when you analyze the data.
There might be solutions, but they will most probably involve heavy programming.
In the data file you can save the date for each filled questionnaire. But you can't access this information in another questionnaire I think. You can only get this later when you analyze the data.
There might be solutions, but they will most probably involve heavy programming.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: Maris
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
9 years 3 months ago #115446
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Date problem - find number of days since last survey
Holch is correct, there is no built-in method to access data from previous submissions. You will need to make an AJAX call to a remote PHP file that queries the database.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Maris
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
9 years 3 months ago #115458
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Date problem - find number of days since last survey
Another solution could be placing a cookie on submit and reading that cookie at the next survey start using JS.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: Maris
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
9 years 3 months ago #115462
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Date problem - find number of days since last survey
Yes, but that assumes the respondent would use the same machine and browser.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
9 years 3 months ago #115463
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Date problem - find number of days since last survey
Yep
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- Maris
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
9 years 3 months ago - 9 years 3 months ago #115466
by Maris
Replied by Maris on topic Date problem - find number of days since last survey
Ah. Thank you. Heavy programming... hmmmm... might need a jack for this. :blink:
Thank you again. I [strike]might[/strike] will likely be back with more questions.
Thank you again. I [strike]might[/strike] will likely be back with more questions.
Last edit: 9 years 3 months ago by Maris.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
9 years 3 months ago - 9 years 3 months ago #115491
by DenisChenu
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.
Replied by DenisChenu on topic Date problem - find number of days since last survey
Think using a:
- Token table not anonymous enable
- No token persistence
- Allow update or infinite answer
- date enabled
After add a plugin : beforeSurveyPage event.
- Look if survey is started (if it's already started: do nothing)
- A start of survey :search for the last submitted entry with this token (find('conditions'=>"token=:token and submitted is not null",'order'=>'id desc','params'=>array(":token"=>$tokenUser)) or somthing like thta).
- Add it somewhere in the survey (a hidden texte question for example (fill the $_SESSION var).
- USing this question in description text of the survey (for example).
Denis
- Token table not anonymous enable
- No token persistence
- Allow update or infinite answer
- date enabled
After add a plugin : beforeSurveyPage event.
- Look if survey is started (if it's already started: do nothing)
- A start of survey :search for the last submitted entry with this token (find('conditions'=>"token=:token and submitted is not null",'order'=>'id desc','params'=>array(":token"=>$tokenUser)) or somthing like thta).
- Add it somewhere in the survey (a hidden texte question for example (fill the $_SESSION var).
- USing this question in description text of the survey (for example).
Denis
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: 9 years 3 months ago by DenisChenu.
The following user(s) said Thank You: Maris
The topic has been locked.