View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
06787Bug reportsSurvey editingpublic2012-11-09 19:11
Reporterspacejanitor Assigned ToDenisChenu  
PriorityurgentSeveritypartial_block 
Status closedResolutionno change required 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary06787: Multiple numerical input w/ sub-question equation validation + array filter
Description

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.

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 Reproduce

Make 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.

TagsNo tags attached.
Attached Files
Bug heat8
Complete LimeSurvey version number (& build)121025
I will donate to the project if issue is resolvedNo
BrowserFirefox 16.0.1
Database type & versionmySQL 5
Server OS (if known)Ubuntu
Webserver software & version (if known)Apache 2.4.3
PHP Version5.4

Users monitoring this issue

Mazi

Activities

spacejanitor

spacejanitor

2012-10-27 14:52

reporter   ~21727

http://www.limesurvey.org/en/forum/design-issues/87424-bug-multiple-numerical-input-w-sub-question-equation-validation--array-filter#87433

TMSWhite

TMSWhite

2012-10-27 15:34

reporter   ~21729

Not a bug but a mis-use of the 'that' macro variable. Please read the documentation and try the sample surveys

spacejanitor

spacejanitor

2012-10-27 17:10

reporter   ~21731

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.

spacejanitor

spacejanitor

2012-10-27 17:18

reporter   ~21732

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.

TMSWhite

TMSWhite

2012-10-27 17:25

reporter   ~21733

Still not a bug. Works exactly as designed. To avoid having filtered variables prevent validation, use .NAOK on all variables.

spacejanitor

spacejanitor

2012-10-27 17:30

reporter   ~21734

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.

TMSWhite

TMSWhite

2012-10-27 18:37

reporter   ~21735

I can look at this on Tuesday if somebody wants to look at it earlier that would be appreciated

spacejanitor

spacejanitor

2012-10-28 14:57

reporter   ~21740

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).

TMSWhite

TMSWhite

2012-11-09 01:59

reporter   ~22038

I'm not going to have time to look into this for at least another week. Freeing this up for another developer.

DenisChenu

DenisChenu

2012-11-09 19:11

developer   ~22046

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-27 21:15 Mazi Issue Monitored: Mazi
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+
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-08-08 10:27 guest Bug heat 6 => 8