Welcome to the LimeSurvey Community Forum

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

replace placeholder linked to an answer to another question

More
9 years 11 months ago #125789 by tpartner
Please attach a small sample survey with just those name questions and the following text question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 11 months ago #125792 by Thomassie
The topic has been locked.
More
9 years 11 months ago #125805 by tpartner
Oops, sorry, somewhere in the cutting and pasting I got the parameters of the substr function backwards. And since you have conditional questions we should also add ".NAOK" to the Expression Manager variables.

Code:
{if(substr(A41.NAOK, 0, 1) == 'V', 'she', if(substr(A41.NAOK, 0, 1) == 'M', 'he', ''))}
{if(substr(A42.NAOK, 0, 1) == 'V', 'she', if(substr(A42.NAOK, 0, 1) == 'M', 'he', ''))} 
{if(substr(A43.NAOK, 0, 1) == 'V', 'she', if(substr(A43.NAOK, 0, 1) == 'M', 'he', ''))}
{if(substr(A44.NAOK, 0, 1) == 'V', 'she', if(substr(A44.NAOK, 0, 1) == 'M', 'he', ''))}

Try this survey:

File Attachment:

File Name: limesurvey...2822.lss
File Size:73.76 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 11 months ago #125831 by Thomassie
Thanks Tony,

it works perfect. Just out of interest, what does .NAOK do in the code ?
The topic has been locked.
More
9 years 11 months ago #126045 by DenisChenu
We have a manual , it's great if you read it : www.limesurvey.org/manual/Expression_Man...#Access_to_Variables

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
9 years 8 months ago #129236 by Ben_V
Hi,
I'm trying without success to use " substr" in a multiple choice question to count easily Tony's boys & girls friends.
Is this possible ?

Thanks...

Note: attached sample "substr/checkboxes" is for the moment also present/inactivate at the demo platform)

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)
The topic has been locked.
More
9 years 8 months ago #129244 by tpartner
I don't think you can get there with Expression Manager because (as far as I know) there is no way to selectively access the checked items sub-question codes.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 8 months ago - 9 years 8 months ago #129248 by DenisChenu
Hi ,

Usage of that and sub-suffix sq_:
Boys: {count(that.Q1.sq_M)} => count(that.Q1.sq_M)
Girls: {count(that.Q1.sq_F)} => count(that.Q1.sq_F)
Code:
demo.limesurvey.org/index.php?r=admin/questions/sa/editquestion/surveyid/231563/gid/32/qid/172

www.limesurvey.org/manual/Expression_Man....27that.27_variables

:)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
Last edit: 9 years 8 months ago by DenisChenu.
The following user(s) said Thank You: Ben_V
The topic has been locked.
More
9 years 8 months ago #129250 by tpartner
??? How does that work? Surely you should need the entire sub-question code when using a sub-selector with that.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 8 months ago #129252 by Ben_V
Denis : Waouh, very useful, merci ;)
Tony: to give javascript a chance I will ask the forum in 2016 for aircraft/theater seat selection and reservations using LimeSurvey :)

Note: I suppose it's ok to use the demo instal like I did; if not just say it.

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)
The topic has been locked.
More
9 years 8 months ago #129256 by DenisChenu

tpartner wrote: ??? How does that work? Surely you should need the entire sub-question code when using a sub-selector with that.

No :) .

sq_X - where X is a row or column identifier. Only sub-questions matching pattern X are selected. Note that search is done on complete code identifier, then sq_X match and include subquestions nX, X, Xn (e.g. if you use sq_1, subquestions a1, 1a, 1, 11 or 001 was included). Put attention at dual scale question type where subquestions code are QCODE_SQCODE_1 and QCODE_SQCODE_1 and to ranking question type where subquestions code are QCODE_1,QCODE_2 ....

;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: Ben_V
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose