Half and half

3 years 11 months ago #114108
SnowyEgret created the topic: Half and half
I have two groups of questions. The first I would like to present to odd numbered respondents, the second to the even numbered respondents. How can I do this with LimeSurvey?

3 years 11 months ago #114116 by Ben_V
Ben_V replied the topic: Half and half
Hi,
you can use the group relevance equation field to set a condition on the last number of the respondant ID
Obviously, your survey must be activated

for 0, 2, 4 etc.
`((substr(SAVEDID, -1) == "0") or (substr(SAVEDID, -1) == "2") or (substr(SAVEDID, -1) == "4") or (substr(SAVEDID, -1) == "6") or (substr(SAVEDID, -1) == "8"))`

for 1, 3 , 5 etc
`((substr(SAVEDID, -1) == "1") or (substr(SAVEDID, -1) == "3") or (substr(SAVEDID, -1) == "5") or (substr(SAVEDID, -1) == "7") or (substr(SAVEDID, -1) == "9"))`

Note: {substr(SAVEDID, -1)} retrieve the last character of {SAVEDID}
.

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 following user(s) said Thank You: SnowyEgret

3 years 11 months ago #114175
SnowyEgret replied the topic: Half and half
Thanks Ben this will work fine for me.

Just out of interest, could I set up a counter of type integer in a hidden question at the top of the survey which I would be able access globally and do modular arithmetic on?

3 years 11 months ago #114178 by Ben_V
Ben_V replied the topic: Half and half
However I don't understand well your question... i think that you can achieve almost everything if you have an extensive look at all available EM functions .
For example I recommend you this old great post ...

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)

3 years 11 months ago #114201 by Mazi
Mazi replied the topic: Half and half

SnowyEgret wrote: Thanks Ben this will work fine for me.

Just out of interest, could I set up a counter of type integer in a hidden question at the top of the survey which I would be able access globally and do modular arithmetic on?

If by counter you mean a counter for counting the current number of completed data sets, then this isn't possible because the Limesurvey placeholders can only refer to data of the current survey session.
Only the current data set ID ({SAVEDID}) can be used for that.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The following user(s) said Thank You: SnowyEgret