Fill a hidden radio question from array for quota

More
4 months 3 weeks ago - 4 months 3 weeks ago #156255 by tixeon
tixeon created the topic: Fill a hidden radio question from array for quota
I want to screen out on an array question using quotas (have to use quotas instead of a screen out page with submit button removed as I have to use a screen out URL divert for a panel) but Limesurvey won't let me quota on an array, so I figure I need to do a equation/hidden question work-around?

The question is


S1 How often do you...?

Answer options
1 daily
2 weekly
3 fortnightly
4 monthly
5 less often
6 never

subquesitons
1 option 1
2 option 2
3 option 3
4 option 4

The screen out needs to be those who DONT do option 1 OR option 2 at least weekly

I figure I need to create a hidden radio question with a 'screen out' answer option and then an equation that selects 'screen out' in this radio if (option 1 NOT 1 or 2) AND (option 2 NOT 1 or 2). I am having a lot of trouble working out the equation to do this.
Attachments:
Last Edit: 4 months 3 weeks ago by tixeon. Reason: Upload example lss

Please Log in to join the conversation.

More
4 months 3 weeks ago - 4 months 3 weeks ago #156282 by tpartner
tpartner replied the topic: Fill a hidden radio question from array for quota
Given a quota question code "HQwork" and answer code "A1", it seems to me that the assignment equation should be:

{HQwork = if(S1_SQ001 != 'A1' && S1_SQ001 != 'A2' && S1_SQ002 != 'A1' && S1_SQ002 != 'A2', 'A1', '')}

More on the assignment operator here - manual.limesurvey.org/Expression_Manager..._Assignment_Operator

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 months 3 weeks ago by tpartner.
The following user(s) said Thank You: DenisChenu, tixeon

Please Log in to join the conversation.

More
4 months 3 weeks ago #156295 by tixeon
tixeon replied the topic: Fill a hidden radio question from array for quota
Thank you, unfortunately that doesn't work. Could it be that the version I am using doesn't like ampersands as they are showing up red (see attached)?


I am using Version 2.05+ Build 140502 - I have plans to upgrade but am waiting for a survey to finish being in field as I don't want to risk it while I have live surveys.
Attachments:

Please Log in to join the conversation.

More
4 months 2 weeks ago #156361 by aofnoy01
aofnoy01 replied the topic: Fill a hidden radio question from array for quota
Hello

Thank you for the bad luck that did not work. Is it possible that the version I'm using does not like it?

Please Log in to join the conversation.

More
4 months 2 weeks ago #156363 by tixeon
tixeon replied the topic: Fill a hidden radio question from array for quota
Its not too late (launching tomorrow) so I would definitely welcome any further thoughts regarding this. I tried changing the & to 'and' and also using " instead of ' but it still won't work.

Please Log in to join the conversation.

More
4 months 2 weeks ago #156375 by tpartner
tpartner replied the topic: Fill a hidden radio question from array for quota
This should work:

{HQwork = if(S1_SQ001 != 'A1' AND S1_SQ001 != 'A2' AND S1_SQ002 != 'A1' AND S1_SQ002 != 'A2', 'A1', '')}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 months 2 weeks ago #156408 by tixeon
tixeon replied the topic: Fill a hidden radio question from array for quota
Thank you. I tried that but it doesn't work for me. Could you please advise what I am doing wrong?
Attachments:

Please Log in to join the conversation.

More
4 months 2 weeks ago - 4 months 2 weeks ago #156446 by tpartner
tpartner replied the topic: Fill a hidden radio question from array for quota
Two problems...

1) You cannot hide the equation question with the "Always hide this question" setting - in that case it will never be rendered. Hide it with a class "hidden".

2) The equation question is full of garbage HTML. It looks like you pasted directly from the forum into the LimeSurvey editor. Paste first into a plain-text editor like Notepad++ or use the source mode in the LS editor.



Working survey attached:

File Attachment:

File Name: limesurvey...4493.lss
File Size:23 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 4 months 2 weeks ago by tpartner.
The following user(s) said Thank You: tixeon

Please Log in to join the conversation.

More
4 months 2 weeks ago #156520 by tixeon
tixeon replied the topic: Fill a hidden radio question from array for quota
Thank you.

After much pulling out of hair and yelling at the computer I finally figured it out. I didn't realise that you need to go to the next page for the equation to activate. I was expecting it to change the HQwork answer in real time so thought it wasn't working when I was testing (annoying thing is that the very first equation I came up with actually would have worked had I realised this). In hind sight this is obvious.

Also, my version of Limesurvey doesn't have the CSS class option in the advanced question options (not going to upgrade until there are no surveys in field as it is too risky) so I had to put the CSS in the template for that (#questionXX {display: none;}).

It is all working well now though, HOORAY.

Thanks for everyones help!!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!