Welcome to the LimeSurvey Community Forum

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

Precode/Prefill from multiple short text to radio/check box.

  • Kriska
  • Kriska's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #148204 by Kriska
Hi All,

I have the following issue:
I am passing several variables from the panel to the survey via Panel Integretion tab. The only way I found to pass them is to link them to "Multiple short text " type of question. But, later when I download the data, I need to prepare some tables, so having the data in a Multiple short text does not work for me. For example:
I have the variable "gender". "Gender" has to values - 1 - for male and 2 - for female. If I pass "gender" to the first open text box of the "Multiple short text" question, i will have two diffrent values for each respondent in the first place. This does not work for me. I would like to precode each value in a radio qustion, so every respondent will have date for either response 1 male, or response 2 female.
Is it possible variables to be directly precoded in radio questions, not in Multiple short text, or other text questions. Thanks in advance.

Krisi
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #148208 by holch
Why don't you just use a normal short text question? If you only pass the code for the gender to this question, there should be only one code either 1 or 2. Just as you need.

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.
  • Kriska
  • Kriska's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #148211 by Kriska
Hi Holch,
My idea is, that I would like "response 1" of the question to have only one possible value, not two. So I only found the way to precode it. In the text question for "response 1", the possible values will be 1 or 2, in a radio question for "response 1" i will have only value 1, and for "response 2" i will have only value 2.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #148215 by holch
Sorry, I really don't get what you are trying to do.

You have 2 options: Male and female. This means in the gender questions you must allow two different values. Am I getting you wrong?

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
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #148220 by DenisChenu
Question code : Gender , answers : 1: Male 2: Female

Prefill url &Gender=1 for Male / &Gender=2 for Female

It's the way to do according to manual : manual.limesurvey.org/URL_fields#Prefill...using_GET_parameters

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.
  • Kriska
  • Kriska's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #148225 by Kriska
Okay, another question:

How to prefiil/precode/autocode/autopunch form one question to another. For Example:
1. How old are you? - numerical input - respondents can enter 18-75
2. Hidden question precoding to: - list radio
r1. 18-24
r2. 25-34
r3. 35-44
etc.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #148226 by DenisChenu
manual.limesurvey.org/Expression_Manager..._Assignment_Operator . This part must be improved ... maybe construct a FAQ somewhere

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.
  • Kriska
  • Kriska's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #148229 by Kriska
Hi All,
I have already read this. Please send me the code, if you have the time.
Thanks in advance.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago - 7 years 2 months ago #148243 by tpartner
Something like this in an equation type question placed after a list-radio with qCode "radio" (line breaks inserted for clarity):

Code:
{radio=if(age < 25, 'r1', 
      if(age < 35, 'r2', 
        if(age < 45, 'r3', 
          if(age < 55, 'r4', 
            if(age < 65, 'r5', 
            'r6')))))}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 2 months ago by tpartner.
The topic has been locked.
  • Kriska
  • Kriska's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #148287 by Kriska
Hi tpartner,

Thanks a lot. Тhat was the exact example I needed. I managed to make it work the way I wanted on Version 2.55.3+161111.

Best Regards,
Krisi
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #148316 by holch
Gave it a try, but my survey doesn't save answers. weird. Says that it has saved the answers at the end, but not responses appear. will have to investigate this.

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.

Lime-years ahead

Online-surveys for every purse and purpose