LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
06787Bug reports[All Projects] Survey designpublic2012-10-27 14:502012-11-09 19:11
Reporterspacejanitor 
Assigned ToDenisChenu 
PriorityurgentSeveritymajor 
StatusclosedResolutionno change required 
Product Version2.00+ 
Target VersionFixed in Version2.00+ 
Summary06787: Multiple numerical input w/ sub-question equation validation + array filter
DescriptionI'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.

It appears to be an issue with this question type when using array filtering and validation (either subquestion OR whole question... same problem). In my included example, I am using a simpler validation: just testing if each sub-question is a multiple of 3, with the same problem.

It seems the issue is with the validation algorithm trying to use fields which are hidden from the user (because of array filter). It should not be concerned with those fields that have been filtered by the array filter.
Steps To ReproduceMake a numerical input or multiple numerical input question type.
Make another one, and array filter it.
Create subquestion or whole question validation on your 2nd question type, and don't check all options in your 1st question type.
You should be unable to proceed, and may notice some odd behaviour in your "tip" text as well.
I will donate to the project if issue is resolved within 48 hrsNo
LimeSurvey build number OR git commit ID121025
BrowserFirefox 16.0.1
Database & DB-VersionmySQL 5
Operating System (Server)Ubuntu
Webserver software & versionApache 2.4.3
PHP Version5.4
Attached Files? file icon limesurvey_survey_899147.lss [^] (19,491 bytes) 2012-10-27 14:50

- Relationships

-  Notes
User avatar (21727)
spacejanitor (reporter)
2012-10-27 14:52

http://www.limesurvey.org/en/forum/design-issues/87424-bug-multiple-numerical-input-w-sub-question-equation-validation--array-filter#87433 [^]
User avatar (21729)
TMSWhite (reporter)
2012-10-27 15:34

Not a bug but a mis-use of the 'that' macro variable. Please read the documentation and try the sample surveys
User avatar (21731)
spacejanitor (reporter)
2012-10-27 17:10

I believe the key issue still remains. I have re-tested several different ways with the same result.

EM is trying to assess all subquestions regardless of whether or not they were array-filtered. So if Q2_b was not checked, EM will try to assess it against Q3_b as per Q3's equation, making it impossible to proceed.
User avatar (21732)
spacejanitor (reporter)
2012-10-27 17:18

I tried also adding the is_empty function with an OR, but that didn't resolve it either. If the option at Q2 was selected but empty, it would validate, but otherwise, it would not proceed.
User avatar (21733)
TMSWhite (reporter)
2012-10-27 17:25

Still not a bug. Works exactly as designed. To avoid having filtered variables prevent validation, use .NAOK on all variables.
User avatar (21734)
spacejanitor (reporter)
2012-10-27 17:30

I did that:

(Q3_A.NAOK> Q2_A.NAOK) && (Q3_B.NAOK> Q2_B.NAOK) && (Q3_C.NAOK> Q2_C.NAOK)

Still the same result. Sorry to keep re-opening the issue. If it's some basic mistake I'm making I can just continue to reply on the forum thread.
User avatar (21735)
TMSWhite (reporter)
2012-10-27 18:37

I can look at this on Tuesday if somebody wants to look at it earlier that would be appreciated
User avatar (21740)
spacejanitor (reporter)
2012-10-28 14:57

Willing to donate money or my time for speedier resolution. I am not a PHP developer but can help in debugging or diagnosing, and can enlist the help of my PHP developer (has some experience with LS).
User avatar (22038)
TMSWhite (reporter)
2012-11-09 01:59

I'm not going to have time to look into this for at least another week. Freeing this up for another developer.
User avatar (22046)
DenisChenu (developer)
2012-11-09 19:11

Hello,

With included lss file : change
((this/ 3) == floor(this/3))
By
((this.NAOK / 3) == floor(this.NAOK/3))
Like Thomas already say and it'sOK.

For:
(Q3_A.NAOK> Q2_A.NAOK) : you ask Q3_A>Q2_A if exist or not : it works exactly as designed. If you do the same thing in javascript : javascript error.

If you do the same in PHP : error.
Use:
(Q3_A.NAOK> Q2_A.NAOK) and !(is_empty(Q3_A.NAOK) or is_empty(Q2_A.NAOK))

Not a bug.

- Issue History
Date Modified Username Field Change
2012-10-27 14:50 spacejanitor New Issue
2012-10-27 14:50 spacejanitor File Added: limesurvey_survey_899147.lss
2012-10-27 14:52 spacejanitor Note Added: 21727
2012-10-27 15:34 TMSWhite Note Added: 21729
2012-10-27 15:34 TMSWhite Status new => closed
2012-10-27 15:34 TMSWhite Assigned To => TMSWhite
2012-10-27 15:34 TMSWhite Resolution open => no change required
2012-10-27 17:10 spacejanitor Note Added: 21731
2012-10-27 17:10 spacejanitor Status closed => feedback
2012-10-27 17:10 spacejanitor Resolution no change required => reopened
2012-10-27 17:18 spacejanitor Note Added: 21732
2012-10-27 17:18 spacejanitor Status feedback => assigned
2012-10-27 17:25 TMSWhite Note Added: 21733
2012-10-27 17:25 TMSWhite Status assigned => closed
2012-10-27 17:25 TMSWhite Resolution reopened => no change required
2012-10-27 17:30 spacejanitor Note Added: 21734
2012-10-27 17:30 spacejanitor Status closed => feedback
2012-10-27 17:30 spacejanitor Resolution no change required => reopened
2012-10-27 18:37 TMSWhite Note Added: 21735
2012-10-28 14:57 spacejanitor Note Added: 21740
2012-10-28 14:57 spacejanitor Status feedback => assigned
2012-11-09 01:59 TMSWhite Note Added: 22038
2012-11-09 01:59 TMSWhite Assigned To TMSWhite =>
2012-11-09 01:59 TMSWhite Status assigned => new
2012-11-09 08:32 c_schmitz Assigned To => DenisChenu
2012-11-09 08:32 c_schmitz Status new => assigned
2012-11-09 19:11 DenisChenu Note Added: 22046
2012-11-09 19:11 DenisChenu Status assigned => closed
2012-11-09 19:11 DenisChenu Resolution reopened => no change required
2012-11-09 19:11 DenisChenu Fixed in Version => 2.00+


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker