Welcome to the LimeSurvey Community Forum

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

Logic challenge: Many-to-Many relationship loop (Faculty vs. Field of Study)

More
1 month 2 weeks ago #273401 by Joffm
Hi,
as promised, here the "open" version.
I also put everything into one survey, just adapted the other - closed- one.

 

File Attachment:

File Name: limesurvey...27_J.lss
File Size:232.36 KB


Disadvantage: The respondent can't interrupt and resume later.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: kkozera

Please Log in to join the conversation.

More
1 month 1 week ago - 1 month 1 week ago #273418 by kkozera
Hi Joffm,

It works very well and this is a huge milestone - thank you.
I have two follow-up questions:
  1. Is it possible to make the survey closed and embed the token in the final URL?
    {if(strlen(pool)>1,' website.de/{SID}?token={token}&lang=de&pid={pid}&pool={pool }','')}
    Right now for each iteration, user is requested to paste the token
  2. I’ve attached a screenshot showing an issue: when a user selects multiple labs within a single faculty, the loop doesn’t behave as intended. It should iterate row-by-row and individual elements in a row as well.
Thanks for your hints in advance.
Last edit: 1 month 1 week ago by kkozera.

Please Log in to join the conversation.

More
1 month 1 week ago #273419 by Joffm
Hi,
1.  Why not? With the correct settings that multiple responses with one token arre allowed.

2. There seems to be something wrong with your javascript.
Send your lss export.

Joffm

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

Please Log in to join the conversation.

More
1 month 1 week ago #273420 by kkozera
It's the same .lss file but I changed end url obviously.

Please Log in to join the conversation.

More
1 month 1 week ago #273421 by Joffm
Hi,
You wrote

our university's IT administrator has strictly refused

Not only this, obviously the XSS filter is ON (many university admins do this); you are not allowed to use javascript. 

This means you have to redesign the question "faculties".
Either the respondents enter an "X" or you use an array(numbers) with checkbox layout.
And as far as I see, the equation "pool" will be much much longer.
In the script there were different results for each column which you used in the equation;
In an array(numbers) each selected column returns "1".
So you have to check each cell like join(if(Q1_01=="Y",join('$01',if(Q2_01_A==1,"A",""),if(Q2_01_B==1,"B",""),if(Q2_01_C==1,"C",""),...

Joffm

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

Please Log in to join the conversation.

More
1 month 1 week ago #273422 by kkozera

Hi,
You wrote

our university's IT administrator has strictly refused

Not only this, obviously the XSS filter is ON (many university admins do this); you are not allowed to use javascript. 
 
After you sent the .lss with updateTokenByResponse settings I kindly asked our IT admin again and he allowed it.

Ok, I will try.

Please Log in to join the conversation.

More
1 month 1 week ago #273423 by Joffm
Without javascript:
Change Q2 to array(numbers) with checkbox layout
Subquestions Y-axis: 01, 02, 03,..., 10, 11,..., 18
Subquestions X-axis: A, B, C, ..., R
 
and change equation "pool0" to
{if(is_empty(pool), join( if(Q1_01=="Y", join('$01', if(Q2_01_A==1,'A',''), if(Q2_01_B==1,'B',''), if(Q2_01_C==1,'C',''), if(Q2_01_D==1,'D',''), if(Q2_01_E==1,'E',''), if(Q2_01_F==1,'F',''), if(Q2_01_G==1,'G',''), if(Q2_01_H==1,'H',''), if(Q2_01_I==1,'I',''), if(Q2_01_J==1,'J',''), if(Q2_01_K==1,'K',''), if(Q2_01_L==1,'L',''), if(Q2_01_M==1,'M',''), if(Q2_01_N==1,'N',''), if(Q2_01_O==1,'O',''), if(Q2_01_P==1,'P',''), if(Q2_01_Q==1,'Q',''), if(Q2_01_R==1,'R','')),''), if(Q1_02=="Y", join('$02', if(Q2_02_A==1,'A',''), if(Q2_02_B==1,'B',''), if(Q2_02_C==1,'C',''), if(Q2_02_D==1,'D',''), if(Q2_02_E==1,'E',''), if(Q2_02_F==1,'F',''), if(Q2_02_G==1,'G',''), if(Q2_02_H==1,'H',''), if(Q2_02_I==1,'I',''), if(Q2_02_J==1,'J',''), if(Q2_02_K==1,'K',''), if(Q2_02_L==1,'L',''), if(Q2_02_M==1,'M',''), if(Q2_02_N==1,'N',''), if(Q2_02_O==1,'O',''), if(Q2_02_P==1,'P',''), if(Q2_02_Q==1,'Q',''), if(Q2_02_R==1,'R','')),''), if(Q1_03=="Y", join('$03', if(Q2_03_A==1,'A',''), if(Q2_03_B==1,'B',''), if(Q2_03_C==1,'C',''), if(Q2_03_D==1,'D',''), if(Q2_03_E==1,'E',''), if(Q2_03_F==1,'F',''), if(Q2_03_G==1,'G',''), if(Q2_03_H==1,'H',''), if(Q2_03_I==1,'I',''), if(Q2_03_J==1,'J',''), if(Q2_03_K==1,'K',''), if(Q2_03_L==1,'L',''), if(Q2_03_M==1,'M',''), if(Q2_03_N==1,'N',''), if(Q2_03_O==1,'O',''), if(Q2_03_P==1,'P',''), if(Q2_03_Q==1,'Q',''), if(Q2_03_R==1,'R','')),''), if(Q1_04=="Y", join('$04', if(Q2_04_A==1,'A',''), if(Q2_04_B==1,'B',''), if(Q2_04_C==1,'C',''), if(Q2_04_D==1,'D',''), if(Q2_04_E==1,'E',''), if(Q2_04_F==1,'F',''), if(Q2_04_G==1,'G',''), if(Q2_04_H==1,'H',''), if(Q2_04_I==1,'I',''), if(Q2_04_J==1,'J',''), if(Q2_04_K==1,'K',''), if(Q2_04_L==1,'L',''), if(Q2_04_M==1,'M',''), if(Q2_04_N==1,'N',''), if(Q2_04_O==1,'O',''), if(Q2_04_P==1,'P',''), if(Q2_04_Q==1,'Q',''), if(Q2_04_R==1,'R','')),''), if(Q1_05=="Y", join('$05', if(Q2_05_A==1,'A',''), if(Q2_05_B==1,'B',''), if(Q2_05_C==1,'C',''), if(Q2_05_D==1,'D',''), if(Q2_05_E==1,'E',''), if(Q2_05_F==1,'F',''), if(Q2_05_G==1,'G',''), if(Q2_05_H==1,'H',''), if(Q2_05_I==1,'I',''), if(Q2_05_J==1,'J',''), if(Q2_05_K==1,'K',''), if(Q2_05_L==1,'L',''), if(Q2_05_M==1,'M',''), if(Q2_05_N==1,'N',''), if(Q2_05_O==1,'O',''), if(Q2_05_P==1,'P',''), if(Q2_05_Q==1,'Q',''), if(Q2_05_R==1,'R','')),''), if(Q1_06=="Y", join('$06', if(Q2_06_A==1,'A',''), if(Q2_06_B==1,'B',''), if(Q2_06_C==1,'C',''), if(Q2_06_D==1,'D',''), if(Q2_06_E==1,'E',''), if(Q2_06_F==1,'F',''), if(Q2_06_G==1,'G',''), if(Q2_06_H==1,'H',''), if(Q2_06_I==1,'I',''), if(Q2_06_J==1,'J',''), if(Q2_06_K==1,'K',''), if(Q2_06_L==1,'L',''), if(Q2_06_M==1,'M',''), if(Q2_06_N==1,'N',''), if(Q2_06_O==1,'O',''), if(Q2_06_P==1,'P',''), if(Q2_06_Q==1,'Q',''), if(Q2_06_R==1,'R','')),''), if(Q1_07=="Y", join('$07', if(Q2_07_A==1,'A',''), if(Q2_07_B==1,'B',''), if(Q2_07_C==1,'C',''), if(Q2_07_D==1,'D',''), if(Q2_07_E==1,'E',''), if(Q2_07_F==1,'F',''), if(Q2_07_G==1,'G',''), if(Q2_07_H==1,'H',''), if(Q2_07_I==1,'I',''), if(Q2_07_J==1,'J',''), if(Q2_07_K==1,'K',''), if(Q2_07_L==1,'L',''), if(Q2_07_M==1,'M',''), if(Q2_07_N==1,'N',''), if(Q2_07_O==1,'O',''), if(Q2_07_P==1,'P',''), if(Q2_07_Q==1,'Q',''), if(Q2_07_R==1,'R','')),''), if(Q1_08=="Y", join('$08', if(Q2_08_A==1,'A',''), if(Q2_08_B==1,'B',''), if(Q2_08_C==1,'C',''), if(Q2_08_D==1,'D',''), if(Q2_08_E==1,'E',''), if(Q2_08_F==1,'F',''), if(Q2_08_G==1,'G',''), if(Q2_08_H==1,'H',''), if(Q2_08_I==1,'I',''), if(Q2_08_J==1,'J',''), if(Q2_08_K==1,'K',''), if(Q2_08_L==1,'L',''), if(Q2_08_M==1,'M',''), if(Q2_08_N==1,'N',''), if(Q2_08_O==1,'O',''), if(Q2_08_P==1,'P',''), if(Q2_08_Q==1,'Q',''), if(Q2_08_R==1,'R','')),''), if(Q1_09=="Y", join('$09', if(Q2_09_A==1,'A',''), if(Q2_09_B==1,'B',''), if(Q2_09_C==1,'C',''), if(Q2_09_D==1,'D',''), if(Q2_09_E==1,'E',''), if(Q2_09_F==1,'F',''), if(Q2_09_G==1,'G',''), if(Q2_09_H==1,'H',''), if(Q2_09_I==1,'I',''), if(Q2_09_J==1,'J',''), if(Q2_09_K==1,'K',''), if(Q2_09_L==1,'L',''), if(Q2_09_M==1,'M',''), if(Q2_09_N==1,'N',''), if(Q2_09_O==1,'O',''), if(Q2_09_P==1,'P',''), if(Q2_09_Q==1,'Q',''), if(Q2_09_R==1,'R','')),''), if(Q1_10=="Y", join('$10', if(Q2_10_A==1,'A',''), if(Q2_10_B==1,'B',''), if(Q2_10_C==1,'C',''), if(Q2_10_D==1,'D',''), if(Q2_10_E==1,'E',''), if(Q2_10_F==1,'F',''), if(Q2_10_G==1,'G',''), if(Q2_10_H==1,'H',''), if(Q2_10_I==1,'I',''), if(Q2_10_J==1,'J',''), if(Q2_10_K==1,'K',''), if(Q2_10_L==1,'L',''), if(Q2_10_M==1,'M',''), if(Q2_10_N==1,'N',''), if(Q2_10_O==1,'O',''), if(Q2_10_P==1,'P',''), if(Q2_10_Q==1,'Q',''), if(Q2_10_R==1,'R','')),''), if(Q1_11=="Y", join('$11', if(Q2_11_A==1,'A',''), if(Q2_11_B==1,'B',''), if(Q2_11_C==1,'C',''), if(Q2_11_D==1,'D',''), if(Q2_11_E==1,'E',''), if(Q2_11_F==1,'F',''), if(Q2_11_G==1,'G',''), if(Q2_11_H==1,'H',''), if(Q2_11_I==1,'I',''), if(Q2_11_J==1,'J',''), if(Q2_11_K==1,'K',''), if(Q2_11_L==1,'L',''), if(Q2_11_M==1,'M',''), if(Q2_11_N==1,'N',''), if(Q2_11_O==1,'O',''), if(Q2_11_P==1,'P',''), if(Q2_11_Q==1,'Q',''), if(Q2_11_R==1,'R','')),''), if(Q1_12=="Y", join('$12', if(Q2_12_A==1,'A',''), if(Q2_12_B==1,'B',''), if(Q2_12_C==1,'C',''), if(Q2_12_D==1,'D',''), if(Q2_12_E==1,'E',''), if(Q2_12_F==1,'F',''), if(Q2_12_G==1,'G',''), if(Q2_12_H==1,'H',''), if(Q2_12_I==1,'I',''), if(Q2_12_J==1,'J',''), if(Q2_12_K==1,'K',''), if(Q2_12_L==1,'L',''), if(Q2_12_M==1,'M',''), if(Q2_12_N==1,'N',''), if(Q2_12_O==1,'O',''), if(Q2_12_P==1,'P',''), if(Q2_12_Q==1,'Q',''), if(Q2_12_R==1,'R','')),''), if(Q1_13=="Y", join('$13', if(Q2_13_A==1,'A',''), if(Q2_13_B==1,'B',''), if(Q2_13_C==1,'C',''), if(Q2_13_D==1,'D',''), if(Q2_13_E==1,'E',''), if(Q2_13_F==1,'F',''), if(Q2_13_G==1,'G',''), if(Q2_13_H==1,'H',''), if(Q2_13_I==1,'I',''), if(Q2_13_J==1,'J',''), if(Q2_13_K==1,'K',''), if(Q2_13_L==1,'L',''), if(Q2_13_M==1,'M',''), if(Q2_13_N==1,'N',''), if(Q2_13_O==1,'O',''), if(Q2_13_P==1,'P',''), if(Q2_13_Q==1,'Q',''), if(Q2_13_R==1,'R','')),''), if(Q1_14=="Y", join('$14', if(Q2_14_A==1,'A',''), if(Q2_14_B==1,'B',''), if(Q2_14_C==1,'C',''), if(Q2_14_D==1,'D',''), if(Q2_14_E==1,'E',''), if(Q2_14_F==1,'F',''), if(Q2_14_G==1,'G',''), if(Q2_14_H==1,'H',''), if(Q2_14_I==1,'I',''), if(Q2_14_J==1,'J',''), if(Q2_14_K==1,'K',''), if(Q2_14_L==1,'L',''), if(Q2_14_M==1,'M',''), if(Q2_14_N==1,'N',''), if(Q2_14_O==1,'O',''), if(Q2_14_P==1,'P',''), if(Q2_14_Q==1,'Q',''), if(Q2_14_R==1,'R','')),''), if(Q1_15=="Y", join('$15', if(Q2_15_A==1,'A',''), if(Q2_15_B==1,'B',''), if(Q2_15_C==1,'C',''), if(Q2_15_D==1,'D',''), if(Q2_15_E==1,'E',''), if(Q2_15_F==1,'F',''), if(Q2_15_G==1,'G',''), if(Q2_15_H==1,'H',''), if(Q2_15_I==1,'I',''), if(Q2_15_J==1,'J',''), if(Q2_15_K==1,'K',''), if(Q2_15_L==1,'L',''), if(Q2_15_M==1,'M',''), if(Q2_15_N==1,'N',''), if(Q2_15_O==1,'O',''), if(Q2_15_P==1,'P',''), if(Q2_15_Q==1,'Q',''), if(Q2_15_R==1,'R','')),''), if(Q1_16=="Y", join('$16', if(Q2_16_A==1,'A',''), if(Q2_16_B==1,'B',''), if(Q2_16_C==1,'C',''), if(Q2_16_D==1,'D',''), if(Q2_16_E==1,'E',''), if(Q2_16_F==1,'F',''), if(Q2_16_G==1,'G',''), if(Q2_16_H==1,'H',''), if(Q2_16_I==1,'I',''), if(Q2_16_J==1,'J',''), if(Q2_16_K==1,'K',''), if(Q2_16_L==1,'L',''), if(Q2_16_M==1,'M',''), if(Q2_16_N==1,'N',''), if(Q2_16_O==1,'O',''), if(Q2_16_P==1,'P',''), if(Q2_16_Q==1,'Q',''), if(Q2_16_R==1,'R','')),''), if(Q1_17=="Y", join('$17', if(Q2_17_A==1,'A',''), if(Q2_17_B==1,'B',''), if(Q2_17_C==1,'C',''), if(Q2_17_D==1,'D',''), if(Q2_17_E==1,'E',''), if(Q2_17_F==1,'F',''), if(Q2_17_G==1,'G',''), if(Q2_17_H==1,'H',''), if(Q2_17_I==1,'I',''), if(Q2_17_J==1,'J',''), if(Q2_17_K==1,'K',''), if(Q2_17_L==1,'L',''), if(Q2_17_M==1,'M',''), if(Q2_17_N==1,'N',''), if(Q2_17_O==1,'O',''), if(Q2_17_P==1,'P',''), if(Q2_17_Q==1,'Q',''), if(Q2_17_R==1,'R','')),''), if(Q1_18=="Y", join('$18', if(Q2_18_A==1,'A',''), if(Q2_18_B==1,'B',''), if(Q2_18_C==1,'C',''), if(Q2_18_D==1,'D',''), if(Q2_18_E==1,'E',''), if(Q2_18_F==1,'F',''), if(Q2_18_G==1,'G',''), if(Q2_18_H==1,'H',''), if(Q2_18_I==1,'I',''), if(Q2_18_J==1,'J',''), if(Q2_18_K==1,'K',''), if(Q2_18_L==1,'L',''), if(Q2_18_M==1,'M',''), if(Q2_18_N==1,'N',''), if(Q2_18_O==1,'O',''), if(Q2_18_P==1,'P',''), if(Q2_18_Q==1,'Q',''), if(Q2_18_R==1,'R','')),''),'$'),pool)}

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

Please Log in to join the conversation.

More
1 week 2 days ago #273628 by kkozera
Thanks Joffm!

Finally I had the time to sit down and implement the solution you provided. It works perfectly! Thank you so much!

Kamil

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose