View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
08349Bug reportsExpression Managerpublic2013-11-08 16:05
Reporternfuria Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Product Version2.00+ 
Summary08349: EM validation error
Description

A first question c3 is a multiple numeric input with 10 or more subquestions:
c3 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
The following question c4 is an array (numbers):
c4 => y-scale => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 x-scale => a, b, c, d, e...
The validation must verify that the sum of x-scale subquestions are equal to the values of the previous response subquestions.
If the user choose the subquestion 1 and the subquestion 10 of first question (c3), the validation fails.

Steps To Reproduce

When are used simple numbers for the c3 question subquestions, with or without prefix
(1, 2, 3...10 or a1, a2... a10) and are used the normal rules to write the validation
(sum(self.sq_1.NAOK)==c3_1.NAOK) &&
(sum(self.sq_2.NAOK)==c3_2.NAOK) &&
(sum(self.sq_3.NAOK)==c3_3.NAOK) && ...
the computed validation becomes wrong, as it put in the same line the values for subquestion 1 and subquestion 10:
(sum(c4_1_a.NAOK, c4_1_b.NAOK, c4_1_c.NAOK, c4_1_d.NAOK, c4_1_e.NAOK, c4_10_a.NAOK, c4_10_b.NAOK, c4_10_c.NAOK, c4_10_d.NAOK, c4_10_e.NAOK) == c3_1.NAOK) &&
(sum(c4_2_a.NAOK, c4_2_b.NAOK, c4_2_c.NAOK, c4_2_d.NAOK, c4_2_e.NAOK) == c3_2.NAOK) &&
(sum(c4_3_a.NAOK, c4_3_b.NAOK, c4_3_c.NAOK, c4_3_d.NAOK, c4_3_e.NAOK) == c3_3.NAOK) &&
...
(sum(c4_10_a.NAOK, c4_10_b.NAOK, c4_10_c.NAOK, c4_10_d.NAOK, c4_10_e.NAOK) == c3_10.NAOK)
where the correct equations is:
(sum(c4_1_a.NAOK, c4_1_b.NAOK, c4_1_c.NAOK, c4_1_d.NAOK, c4_1_e.NAOK) == c3_1.NAOK) &&
(sum(c4_2_a.NAOK, c4_2_b.NAOK, c4_2_c.NAOK, c4_2_d.NAOK, c4_2_e.NAOK) == c3_2.NAOK) &&
(sum(c4_3_a.NAOK, c4_3_b.NAOK, c4_3_c.NAOK, c4_3_d.NAOK, c4_3_e.NAOK) == c3_3.NAOK) &&
...
(sum(c4_10_a.NAOK, c4_10_b.NAOK, c4_10_c.NAOK, c4_10_d.NAOK, c4_10_e.NAOK) == c3_10.NAOK)

The validation QA say that all is correct and show the wrong computation, but is hard to see the error.
In my first tests I don't choose the subquestions 1 and 10, and didn't see the error.
If there are more subquestions (11, 12, 13...) the line sum all these that begin with "1".

Additional Information

There are two simple workarounds:
a) rename the first question subquestions:
c3 => a01, a02, a03... a10, a11
b) write the complete validation:
(sum(c4_1_a.NAOK, c4_1_b.NAOK, c4_1_c.NAOK, c4_1_d.NAOK, c4_1_e.NAOK) == c3_1.NAOK) &&
...

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build)Version 2.00+ Build 131031
I will donate to the project if issue is resolvedNo
BrowserChrome and Safari
Database type & version5.6.14 MySQL
Server OS (if known)Mac OS X 10.8 and Linux hm5399 2.6.32.60-grsec-2.yos.x86_64
Webserver software & version (if known)Mac OS X 10.8 and Linux hm5399 2.6.32.60-grsec-2.yos.x86_64
PHP VersionPHP Version 5.3.26 and PHP Version 5.2.17
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

nfuria

nfuria

2013-11-08 00:57

reporter   ~27145

There are a functional survey to demonstrate the problem here:
http://www.icatalogos.com.br/cinau/178268/

DenisChenu

DenisChenu

2013-11-08 08:28

developer   ~27146

I have a look, but i think it's OK here.

<quote>Only sub-questions matching pattern X are selected. </quote>

For dual scale, subquestion code are:

  • QCODE_SQ1_1 and QCODE_SQ1_2, then when you use sq_1 EM search for 1 then find:
    _1 or _10:
    • SCODE_1_2
    • SCODE_10_2
    • SCODE_2_1
      are all three OK

Maybe we can remove the dual scale , but we can not remove the _10. Other user use sq_A with sub question code like this:
A1
A2
A3
B1
B2
B3

nfuria

nfuria

2013-11-08 13:44

reporter   ~27160

Last edited: 2013-11-08 13:55

I was thinking that EM was implemented for search a non greedy pattern
/^sq_X$/ => /^sq_1$/ or /^sq_a1$/
but the pattern that EM search is greedy
/^sq_X.$/ => /^sq_1.$/ or /^sq_a1.*$/

Then we need to take care about the code of subquestions and alter the necessary to avoid misinterpretation as I already did changing my subcodes from "1, 2, …10" to "a01, a02… a10".

Maybe it deserves a note in the manual to explain the greediness of the pattern
<quote>Only sub-questions matching pattern X are selected. </quote>

Thanks

DenisChenu

DenisChenu

2013-11-08 16:00

developer   ~27162

Yes, maybe doc is not clear here.

It can be a feature request, but sure default is XX%
Maybe we can have XX- => search only for XX (or something other).

Denis

DenisChenu

DenisChenu

2013-11-08 16:05

developer   ~27163

Update doc : add a little example.

Issue History

Date Modified Username Field Change
2013-11-07 18:54 nfuria New Issue
2013-11-07 18:54 nfuria File Added: limesurvey_survey_486379.lss
2013-11-08 00:01 c_schmitz Assigned To => DenisChenu
2013-11-08 00:01 c_schmitz Status new => assigned
2013-11-08 00:57 nfuria Note Added: 27145
2013-11-08 08:28 DenisChenu Note Added: 27146
2013-11-08 13:44 nfuria Note Added: 27160
2013-11-08 13:50 nfuria Note Edited: 27160
2013-11-08 13:54 nfuria Note Edited: 27160
2013-11-08 13:55 nfuria Note Edited: 27160
2013-11-08 16:00 DenisChenu Note Added: 27162
2013-11-08 16:05 DenisChenu Note Added: 27163
2013-11-08 16:05 DenisChenu Status assigned => closed
2013-11-08 16:05 DenisChenu Resolution open => no change required