Check Logic Errors

More
11 months 2 weeks ago #161975 by GaurdianShield
GaurdianShield created the topic: Check Logic Errors
When I run check logic on my survey I get the following error on one question.
Each question has one sub-question - "Please select your response", and 11 Answer options.

The question code in this error message is ACTV1:


(VALIDATION: ((if(is_empty(1), 1, count(ACTV1_SQ001.NAOK) <= (1))))


(Tip: if( ! is_empty('') && is_empty(1) && ('') != 1, sprintf('Please select at least %s answers', fixnum('')), '')
if( ! is_empty('') && is_empty(1) && ('') == 1, sprintf('Please select at least one answer', fixnum('')), '')
if(is_empty('') && ! is_empty(1) && (1) != 1, sprintf('Please select at most %s answers', fixnum(1)), '')
if(is_empty('') && ! is_empty(1) && (1) == 1, sprintf('Please select at most one answer', fixnum(1)), '')
if( ! is_empty('') && ! is_empty(1) && ('') == (1) && ('') == 1, 'Please select one answer', '')
if( ! is_empty('') && ! is_empty(1) && ('') == (1) && ('') != 1, sprintf('Please select %s answers', fixnum('')), '')
if( ! is_empty('') && ! is_empty(1) && ('') != (1), sprintf('Please select from %s to %s answers.', fixnum(''), fixnum(1)), '') )

SQ-1 ACTV1_SQ001 Please select your response

Question attribute Value
statistics_showgraph 1
max_answers 1
random_order 1
scale_export 2

NOTE: All the questions are set up the same, but the error only comes up for one question each time.

If I delete the question that had the error and re-create it, Check Logic brings up the same error for a different question that had no error the previous time Check Logic was run.
The error is always for one question only, even though they are all configured the same.

How can I address this issue?

Please Log in or Create an account to join the conversation.

More
11 months 2 weeks ago - 11 months 2 weeks ago #161994 by tpartner
tpartner replied the topic: Check Logic Errors
Why are you using an IF statements in the question validation equation.

Wouldn't an OR work?

is_empty(1) OR count(ACTV1_SQ001.NAOK) <= 1

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 11 months 2 weeks ago by tpartner.

Please Log in or Create an account to join the conversation.

More
11 months 2 weeks ago #162010 by GaurdianShield
GaurdianShield replied the topic: Check Logic Errors
That's just it, I didn't do any custom coding. I used the GUI. So, I don't know why the errors are popping up.
I didn't enter the code. Any idea why I'm getting code related errors?

Thanks in advance

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!