Welcome to the LimeSurvey Community Forum

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

Check Logic Errors

  • GaurdianShield
  • GaurdianShield's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #161975 by GaurdianShield
Check Logic Errors was created by GaurdianShield
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?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago - 6 years 10 months ago #161994 by tpartner
Replied by tpartner on topic Check Logic Errors
Why are you using an IF statements in the question validation equation.

Wouldn't an OR work?

Code:
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: 6 years 10 months ago by tpartner.
The topic has been locked.
  • GaurdianShield
  • GaurdianShield's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #162010 by GaurdianShield
Replied by GaurdianShield on 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
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose