- Posts: 11672
- Thank you received: 2747
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Use variables (eg. username) in survey
- holch
- Offline
- LimeSurvey Community Team
Less
More
5 years 7 months ago #174655
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 Use variables (eg. username) in survey
I am actually not quite sure what you are trying to do here. Could you explain again what exactly should be happening?
Because the code you wrote checks if the field is empty.
If the field is empty it should write "Leer" (Empty) and if there is already something in there it would write "Gefüllt" (filled). So in the later case it would actually overwrite what is in the field and write "Gefüllt" over it.
Because the code you wrote checks if the field is empty.
If the field is empty it should write "Leer" (Empty) and if there is already something in there it would write "Gefüllt" (filled). So in the later case it would actually overwrite what is in the field and write "Gefüllt" over it.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
5 years 7 months ago #174656
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Use variables (eg. username) in survey
Attach your current survey to check for errors. Might be a issue with LimeSurvey, might be a little mistype. Which version of LimeSurvey is used?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- juppix
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 0
5 years 7 months ago #174658
by juppix
Replied by juppix on topic Use variables (eg. username) in survey
I have addidition fields in the database (Additional user infos).
If have some questions and I want that a user could re-open his survey (edit fields after submitting survey).
If a user opens the survey first time I want to provide a "predicted"/prefilled answer (from the database).
Then the user can usethis predicted/prefilled answer or could insert another answer. After that he submitts the survey again.
If he re-opens his survey he should get his old values as answers (not stored from the database).
I hope I could explain it correctly. Or better: read the first 3-4 posts of this topic to understand what I mean
VERSION:
Version 3.14.10+180924
If have some questions and I want that a user could re-open his survey (edit fields after submitting survey).
If a user opens the survey first time I want to provide a "predicted"/prefilled answer (from the database).
Then the user can usethis predicted/prefilled answer or could insert another answer. After that he submitts the survey again.
If he re-opens his survey he should get his old values as answers (not stored from the database).
I hope I could explain it correctly. Or better: read the first 3-4 posts of this topic to understand what I mean
VERSION:
Version 3.14.10+180924
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11672
- Thank you received: 2747
5 years 7 months ago #174660
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 Use variables (eg. username) in survey
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.
Once a survey has been submitted, you can't reopen it and edit responses afaik. I think here is the problem.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11672
- Thank you received: 2747
5 years 7 months ago #174661
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 Use variables (eg. username) in survey
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.Or better: read the first 3-4 posts of this topic to understand what I mean
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13667
- Thank you received: 2496
5 years 7 months ago #174664
by DenisChenu
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 service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Use variables (eg. username) in survey
I nreally don't understand what you want to do …juppix wrote: Thanks! But the input field is empty
Please take a look at the screenhot (attachment).
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 service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- juppix
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 0
5 years 7 months ago #174668
by juppix
Replied by juppix on topic Use variables (eg. username) in survey
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.
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.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13667
- Thank you received: 2496
5 years 7 months ago #174672
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 Use variables (eg. username) in survey
It's EXACTLY the prupose of default value …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.
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.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11672
- Thank you received: 2747
5 years 7 months ago - 5 years 7 months ago #174674
by holch
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.
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 Use variables (eg. username) in survey
Already forgotten.I have to apologize for being rude. That was definitely not my vote.
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.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.
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
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Last edit: 5 years 7 months ago by holch.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10113
- Thank you received: 3595
5 years 7 months ago #174681
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 Use variables (eg. username) in survey
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?
Have you tried default answers?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11672
- Thank you received: 2747
5 years 7 months ago #174683
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 Use variables (eg. username) in survey
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).
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).
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10113
- Thank you received: 3595
5 years 7 months ago #174684
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 Use variables (eg. username) in survey
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.