Welcome to the LimeSurvey Community Forum

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

Survey to get answer from previous responses/records

  • tpervaiz
  • tpervaiz's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 3 months ago #213333 by tpervaiz
Hi,

I have created a survey with following questions:

First time visited: Y/N
If Yes, What time: Date/Time
Second time visited: Y/N
If Yes, What time: Date/Time

My question is that if user has already filled the survey and selected that he visited first time by selecting the date/time and submitted. Once he open the same survey another time then First time visited, Date and time questions should be pre-filled for him based on the last response he entered

Is it possible?

Thanks in advance

 
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago #213341 by tpartner
Assuming you are using tokens, Denis has a plugin to update token attributes - gitlab.com/SondagesPro/TokenManagement/updateTokenByResponse

You can use the attribute to load the date question.

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: DenisChenu
The topic has been locked.
  • tpervaiz
  • tpervaiz's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 3 months ago #213345 by tpervaiz
Thanks tpartner I have installed the plugin, May i know how can I use the attribute to lead the question response
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago #213347 by Joffm
1. create an additional attribute in your participants table.
2. edit the settings of the plugin 
 
You see, I called the date question "QDate".

3. Set the default value of the date question to this attribute
 

And the result is:
   



And in the next survey:
 

The text is done by micro-tayloring, like

{if(is_empty(TOKEN:ATTRIBUTE_1),"This is your first visit. Please, enter date and time","This visited us before. This date is entered below")}


You did not show us how you want to display this.
So you will have to adapt.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
4 years 3 months ago #213349 by DenisChenu
Else : if you use token persistence : maybe you can use TOKEN:COMPLETED to kow if there are a previous answer ?
And put condition on 2ND visit ?

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.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 months ago - 4 years 3 months ago #213369 by Joffm
But, to be honest, I do not know the reason for the question.

Usually I should think there is a text display saying either
This is your first visit here and afterwards setting the attribute automatically to the current date
or 
Your last visit was {TOKEN:ATTRIBUTE_1}

Setting this {date('l jS \of F Y H:i')} as response to save.
 

 


Please, explain a bit more.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 3 months ago by Joffm.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose