Welcome to the LimeSurvey Community Forum

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

Show a question based on start language

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
5 days 14 hours ago #267934 by blocka
LS : 5.6.68+240625
I'm trying to show a question based on the start language (Survey is English and French, and I want to show a question only if start language was French).
I've tried:
if(STARTLANGUAGE=="fr",1,0)
and
if(LANG=="fr",1,0)

But neither works. What am I doing wrong?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 days 12 hours ago - 5 days 12 hours ago #267935 by Joffm
Replied by Joffm on topic Show a question based on start language
Hi,
what is this?
if(LANG=="fr",1,0)
Is it a question of type equation, or?

To be honest, I do not trust this variable LANG.
Therefore I recommend to create a question of type equation (language) with
english text: {1}
french text: {2}

Now you can use this as condition like
language==2

Here screenshots for German and English
German: both questions
 
English: Only the second question
 

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 days 12 hours ago by Joffm.

Please Log in to join the conversation.

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 days 21 hours ago #267939 by blocka
Replied by blocka on topic Show a question based on start language
Thanks for the suggestion. What I meant was that I'd like to be able to evaluate the lang= parameter that the survey is loaded on.

For example, let's assume I have a bilingual survey with English as base language, and also French, so the survey URLs are:

survey.com/192932?lang=fr
and
survey.com/192932?lang=en

Now I want to have a relevance equation to check if the survey was started with lang=fr or lang=en, so I can show a question to participants who started the survey in French (lang=fr).

Is there a way to accomplish this?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 days 17 hours ago #267940 by Joffm
Replied by Joffm on topic Show a question based on start language
Exactly this is what I showed.

so I can show a question to participants who started the survey in French

As you see in the screenshots the first German question is onyly displeayed if the language is "German"
In case the language is "English": it is not shown.

As I said, I do not really trust the LANG variable.
But today I tested again in 5.6.57

And here
Only with conditions like
LANG=='fr' or LANG!='en'
or something like that.

German
Only first question
 
English
Both questions
   
French
Only second question.



So everything is fine.
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose