Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Can you use the survey language as a condition.

Can you use the survey language as a condition. 3 years 2 weeks ago #101725

  • Hendrik01
  • Hendrik01's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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 2 weeks ago by Hendrik01. Reason: Spelling error
The administrator has disabled public write access.

Can you use the survey language as a condition. 3 years 2 weeks ago #101924

  • lgarzmann
  • lgarzmann's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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.
The administrator has disabled public write access.

Can you use the survey language as a condition. 3 years 2 weeks ago #101926

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6574
  • Thank you received: 1477
  • Karma: 579
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.
The administrator has disabled public write access.

Can you use the survey language as a condition. 3 years 2 weeks ago #101929

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1897
  • Thank you received: 469
  • Karma: 118
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
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.

Can you use the survey language as a condition. 3 years 2 weeks ago #101931

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6574
  • Thank you received: 1477
  • Karma: 579
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.
The administrator has disabled public write access.

Can you use the survey language as a condition. 3 years 2 weeks ago #101932

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6574
  • Thank you received: 1477
  • Karma: 579
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 administrator has disabled public write access.
The following user(s) said Thank You: jonsen

Can you use the survey language as a condition. 3 years 2 weeks ago #101934

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1897
  • Thank you received: 469
  • Karma: 118
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
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The administrator has disabled public write access.

Can you use the survey language as a condition. 3 years 2 weeks ago #101943

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6574
  • Thank you received: 1477
  • Karma: 579
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 2 weeks ago by tpartner.
The administrator has disabled public write access.
Time to create page: 0.628 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form