Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: Bug? Multiple numerical input w/ sub-question equation validation + array filter

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87424

Hi all,

I'm trying to set up a survey where we have 3 questions:
Q1 - Multiple choice (mandatory)
Q2 - Multiple numerical input (mandatory)
Q3 - Multiple numerical input (mandatory)

Q2 and Q3 are array-filtering from Q1.

Each of Q3's values must be greater than Q2's. So, in its sub-question validation, I have put "this > that.Q2"

The survey does not let me proceed unless in Q1, I have checked ALL the options. Meaning that I think the logic behind the sub-question validation checks ALL of the input fields, even if they don't appear because they have been array-filtered. The "Mandatory" check of course does not include those.

Can anybody shed some light on this? I've really struggling to figure this out for the last couple of days. Also, the tip display logic doesn't appear to be working consistently for this either, although I am admittedly a novice with these new features.

I have tested this in 1.92+ and 2.00+

Thank you
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87429

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
Take a look at the logic file. You will see that that.q2 will expand to all subquestions, so the equation is not valid. You need to explicitly test each subquestion via whole question validation not subq validation.
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87430

Yes, I noticed that, but still I thought it would be the best method to use.

The manual states:
The main difference between this feature and the Sub-question validation equations (em_validation_sq option) is that for this feature, if the question (or question parts) fail validation, then an error message could be shown. For the sub-question validation, each text entry cell (e.g. in array, but also applies to single entry question types) will be styled so that the background color is pink.

How would I test each subquestion via whole question validation? I though subquestion validation was for subquestions, and whole question validation was for the sum of the parts?
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87432

I tried it with whole-question validation as well, but it appears to have the same problem.

It should also be noted that I am proceeding in a group-by-group fashion.
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87433

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
The this variable expands to the name of the current subquestion when you use subquestion validaton. If you use whole question validation, that single equation is tested each time a value changes. Try the Demo surveys at /docs/demosurveys/*.lss
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87434

TMSWhite wrote:
The this variable expands to the name of the current subquestion when you use subquestion validaton. If you use whole question validation, that single equation is tested each time a value changes. Try the Demo surveys at /docs/demosurveys/*.lss

Thanks TMSWhite, I have checked out the demos. And actually, what you're saying that it should be doing (the 'this' variable expanding to the name of the current subquestion when you use subquestion validation) is what I want it to be doing: Every time something is typed in to Q3's fields, I want it to check against Q2's fields (so Q3_1 checks against Q2_1... Q3_2 checks against Q2_2... and so on).

The problem is it isn't responding as one would expect. I believe it's trying to validate fields that don't appear because of the array filter, making it impossible to proceed.
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87435

TMSWhite wrote:
The this variable expands to the name of the current subquestion when you use subquestion validaton. If you use whole question validation, that single equation is tested each time a value changes. Try the Demo surveys at /docs/demosurveys/*.lss

For example, for the Question Validation Equation:
(this / 3) == floor(this/3)

for the Question Validation Tip:
{if(!((this / 3) == floor(this/3)),'Bad','Good')}

And I'm creating an array filter from Q1. Very strange behaviour. It never actually displays 'Bad'. It just always displays 'Good' in various colours. And I can't proceed unless all of the checkboxes in Q1 are checked.

If you try a quick implementation of this locally I think you'll see what I mean. I believe it's a problem with array filters equation validation.
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
Last Edit: 3 years 9 months ago by spacejanitor.
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87436

Also just tried the "Demo of em_validation_sq"

There is some strange behaviour on all of the numerical inputs. It's highlighting the fields in red when they ARE valid, and otherwise in white if they are INvalid...

However, the later question types (long free text, short free text) seem to work fine.
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
Last Edit: 3 years 9 months ago by spacejanitor.
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87454

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5974
  • Thank you received: 366
  • Karma: 260
Does the validation work correctly and only the red highlighting is irritating? In this case, this might be template related. Which template do you use (I recommend using the shipped default template for such tests)?

If you think you have found a bug and you can easily reproduce it at the latest Limesurvey 2 version, please file a bug report at our Bugtracker and attach your survey for testing.

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87456

Both the highlighting and validation appear to be incorrect at least for those question types. I will upload my survey at the bug tracker now for your reference.

Thank you
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87461

Here is the link to the bug report where I have uploaded a sample survey for LS2.

bugs.limesurvey.org/view.php?id=6787
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87464

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
Whole question validation should be
Q2_1.NAOK > Q1_1.NAOK && Q2_2.NAOK > Q1_2.NAOK && ...
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87466

Thanks TMSWhite, I check the documentation and try this again.

I'm having to re-learn a lot of things as my previous production version was before the introduction of EM and a lot of other features... but of course I can see this being much more powerful now.
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87467

TMSWhite wrote:
Whole question validation should be
Q2_1.NAOK > Q1_1.NAOK && Q2_2.NAOK > Q1_2.NAOK && ...

You were absolutely right... this suffix did the trick.

However, the tip text doesn't seem to ever change. It always displays 'Good' no matter the input, either in purple, red, or green. Any idea why that could be?

Here's my question validation equation:
(this.NAOK/ 3) == floor(this.NAOK/3)

Here's my subquestion validation tip:
{if(!((this.NAOK/ 3) == floor(this.NAOK/3)),'Good','Bad')}
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
Last Edit: 3 years 9 months ago by spacejanitor.
The administrator has disabled public write access.

Bug? Multiple numerical input w/ sub-question equation validation + array filter 3 years 9 months ago #87468

TMSWhite wrote:
Whole question validation should be
Q2_1.NAOK > Q1_1.NAOK && Q2_2.NAOK > Q1_2.NAOK && ...

Sorry to keep re-replying here. It seems that even with the NAOK suffix and the syntax above, it's not letting me proceed unless ALL options in the array filter are selected. All highlighting is working fine, however.

So it appears that EM is trying to evaluate ALL the options regardless of whether or not they were array filtered, making it impossible to proceed if certain options were not selected.

How do we assess ONLY those options that actually appear to the user (ie, were NOT filtered out by the array filter)? The question contains all of those codes, yes, but because of array filter, it's possible that not all of them are able to ever be selected which seems to break EM's logic unless there's some other way to identify those unselected ones that I'm missing.

Here is my code:
(Q3_A.NAOK > Q2_A.NAOK) && (Q3_B.NAOK > Q2_B.NAOK) && (Q3_C.NAOK > Q2_C.NAOK)

I have tried this with .value, and .code as well. Maybe I'm misunderstanding the term in this context?

I've also attached the survey file.
Attachments:
I'm a call centre and market research technology consultant, lead/sample provider, and panel broker.

I'm also the co-founder and former IT Director of Winning Research Ltd. - LimeSurvey helped the company become a multi-million dollar company within just a few years!
Last Edit: 3 years 9 months ago by spacejanitor.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.378 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form