Welcome to the LimeSurvey Community Forum

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

Use variables (eg. username) in survey

More
6 years 11 months ago #174660 by holch
I have read all of it but it was still not clear what you are trying to do, especially seeing what you are doing.

Once a survey has been submitted, you can't reopen it and edit responses afaik. I think here is the problem.

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.
The topic has been locked.
More
6 years 11 months ago #174661 by holch

Or better: read the first 3-4 posts of this topic to understand what I mean ;)

And by the way: I don't appreciate the attitude. We are trying to help here, you should help us to help you. Therefore: I am out.

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.
The topic has been locked.
More
6 years 11 months ago #174664 by DenisChenu

juppix wrote: Thanks! But the input field is empty :-(
Please take a look at the screenhot (attachment).

I nreally don't understand what you want to do …

And here kontactinfo_SQ001 … but since its a default value … it don't work. Just put {TOKEN:ATTRIBUTE_8} like you done after …

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.
More
6 years 11 months ago #174668 by juppix
I have to apologize for being rude. That was definitely not my vote. My English is not that good.

I have a personallized survey.

Each user gets an email with his own token for the survey.
Now he can fill out the survey and push "submit".
It is possible without problems for the user to open the survey again (re-open with the same token): now he is able to modify (edit) his answers.
This works fine.

Now I want to integrate that the user gets "prefilled" answers if he opens the survey FIRST time. These answers should come out of the limesurvey-users-database (e.g. "{TOKEN:ATTRIBUTE_6}").
This also works fine.
But I just want this behaviour only the FIRST time the survey opens. If the users open the survey 2nd,3rd,... time the "old" (user added) anwers shoud appear.
The topic has been locked.
More
6 years 11 months ago #174672 by DenisChenu

juppix wrote: I…
But I just want this behaviour only the FIRST time the survey opens. If the users open the survey 2nd,3rd,... time the "old" (user added) anwers shoud appear.

It's EXACTLY the prupose of default value …

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.
More
6 years 11 months ago - 6 years 11 months ago #174674 by holch

I have to apologize for being rude. That was definitely not my vote.

Already forgotten. ;-)

It is possible without problems for the user to open the survey again (re-open with the same token): now he is able to modify (edit) his answers.

You are right, with "Enable token-based response persistence:" and "Allow multiple responses or update responses with one token:" set to "ON" this should be possible.

Thinking about it, this should work. You check if empty, which on the first opening should be the case. Then LS should fill the question with the value from the token. If the respondent opens again, there should be a value, so it should not be empty, so then it should use the very same value.

But I think the "." is wrong. I think subquestions are referenced like this (with underscore), if I am not totally wrong.
Code:
questioncode_subquestioncode

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.
Last edit: 6 years 11 months ago by holch.
The topic has been locked.
More
6 years 11 months ago #174681 by tpartner
As Denis points out, default answers should be used for this. If the question is empty and ONLY IF the question is empty, the default answer will be inserted, otherwise no automatic change is made to the question value.

Have you tried default answers?




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.
More
6 years 11 months ago #174683 by holch
The screenshot he shows is from the default answer values ("Antwort-Vorgabewerte" in German), so I guess he is trying this already.
The error must be somewhere else. But as we do not have example LSS, it is difficult.

My guess is still that it is because of the underscore he is using in his test (see screenshot).

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.
The topic has been locked.
More
6 years 11 months ago #174684 by tpartner
Yes, but there is absolutely no reason to use if(is_empty(xx)...

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: holch
The topic has been locked.
More
6 years 11 months ago #174687 by holch

Yes, but there is absolutely no reason to use if(is_empty(xx)...

Now I get it! Thanks!

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.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose