Can you use the survey language as a condition.

More
3 years 6 months ago - 3 years 6 months ago #101725 by Hendrik01
Hendrik01 created the topic: Can you use the survey language as a condition.
Hello,

We are trying to create a survey in several languages with some questions appearing only in some languages.

The survey needs to be anonymous. We will send the url for the specific language to the respondents in the specific country. We do not want to use a visible language switcher.

Some questions are only valid for the German language, others only for English, most questions are for all languages.

Is there any way in Limesurvey to base a condition on the current language, like:
"only use this question when survey_language equals German"

Kind regards,
Hendrik Jan
Last Edit: 3 years 6 months ago by Hendrik01. Reason: Spelling error

Please Log in to join the conversation.

More
3 years 5 months ago #101924 by lgarzmann
lgarzmann replied the topic: Can you use the survey language as a condition.
Get familiar with setting conditions for your questions. I only have the German LimeSurvey installed so I'm not quite sure about the vocabulary.

You can set conditions for every question (the arrow that splits up into two heads).

Then you have to select the language code in the tokens menu. Must equal "de" for German and "en" for English.

Please Log in to join the conversation.

More
3 years 5 months ago #101926 by tpartner
tpartner replied the topic: Can you use the survey language as a condition.
You can use the {SURVEYLANGUAGE} variable in relevance equations.

So, the relevance equations would be:
SURVEYLANGUAGE == "en"
SURVEYLANGUAGE == "de"

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 5 months ago #101929 by Ben_V
Ben_V replied the topic: Can you use the survey language as a condition.
Hello Tony,


Is {SURVEYLANGUAGE} an existing keyword or do you mean {LANG} ?
:unsure:

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

More
3 years 5 months ago #101931 by tpartner
tpartner replied the topic: Can you use the survey language as a condition.
Hi Ben,

It is an existing keyword, most commonly used in startpage.pstpl to add a class to the <body> element.

Of course, when using it in a relevance equation, you omit the curly braces.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 5 months ago #101932 by tpartner
tpartner replied the topic: Can you use the survey language as a condition.
Having said that, a quick look at replacements_helper.php indicates that {LANG}, {SURVEYLANGAGE} and {SURVEYLANGUAGE} should all return the same thing.

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: jonsen

Please Log in to join the conversation.

More
3 years 5 months ago #101934 by Ben_V
Ben_V replied the topic: Can you use the survey language as a condition.
Thank you Tony...
It's more clear for me know and I'll have a look very soon at replacements_helper.php's content for more details...

Note: Consider that it's not an easy job to tell you that you may be wrong :cheer:
.

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

More
3 years 5 months ago - 3 years 5 months ago #101943 by tpartner
tpartner replied the topic: Can you use the survey language as a condition.

Consider that it's not an easy job to tell you that you may be wrong

Oh, I'm wrong often enough!

Besides, this time we are both right :)

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 3 years 5 months ago by tpartner.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now