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 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.
Help us to help you!
Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
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.
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
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
Best regards/Beste Grüße,
Dr. Marcel Minke
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
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.
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
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.