View Issue Details

This bug affects 1 person(s).
 18
IDProjectCategoryView StatusLast Update
06188Bug reportsConditionspublic2012-07-05 22:16
ReporterTMSWhite Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.92+ 
Fixed in Version1.92+ 
Summary06188: error in conditions generated by editor when selecting several options per sub-question
Description

Say have array style question with 4 sub-questions (sq1-sq4) and 5 choices (A-E).

If to create the condition where sq1 is either A or B, and sq2 is either C or D, the conditions editor should show:

(sq1 == 'A' or sq1 == 'B') and (sq2 == 'C' or sq2 == 'D')

instead, it shows:

(sq1 == 'A' and sq1 == 'B' and sq2 == 'C' and sq2 == 'D')

This doesn't always happen with the addition of the second condition, but it does always happen if you add a third sub-question with one or more conditions.

TagsNo tags attached.
Attached Files
caselaw_191vs192.lss (200,286 bytes)
Bug heat18
Complete LimeSurvey version number (& build)120608
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMysql 5.3
Server OS (if known)Windows XP
Webserver software & version (if known)XAMPP
PHP Version5.3

Relationships

related to 06231 closedTMSWhite EM doesn't convert condition correctly, OR becomes AND 
has duplicate 06234 closed unable to AND and OR together sub-questions from same multiple choice question 
related to 06199 closed Survey Rendering Issue for SUBQUESTION (Array) not checked Condition 

Users monitoring this issue

marcrichter

Activities

TMSWhite

TMSWhite

2012-06-10 05:25

reporter   ~19142

This appears to be an error in how the conditions editor displays the conditions. The generated relevance equation is correct.

Mazi

Mazi

2012-06-11 10:06

updater   ~19148

Thibault, my good old friend, any chance you can have a look at this one?

Tom, did you try to reproduce this at an older 1.91 version as well?

TMSWhite

TMSWhite

2012-06-11 13:23

reporter   ~19152

Yes, same error in 1.91+. Attaching a sample survey.

TMSWhite

TMSWhite

2012-06-11 13:28

reporter   ~19153

the conditions-editor-error.jpg shows what the equations should be.

conditions-editor-error2.jpg shows the conditions editor display for test4, for example.

lemeur

lemeur

2012-06-11 14:58

developer   ~19155

Hi Guys,

The fact is that this equation was not supported by the old conditions system, and the GUI was built against the old condition system.

When we decided to integrate the EE engine, we said that its GUI would use a simple syntax coloring tool (if user wanted to use new features) thus disabling the GUI. OR it could use the GUI but limitting its capabilities to what was possible in the past.

So this is not a bug, it's just a feature that was never implemented so far.

TMSWhite

TMSWhite

2012-06-11 15:09

reporter   ~19156

The odd thing, though, is that 1.91+ would let me create that condition (picking two options for each of three different array sub-questions), but the condition editor does not display the value correctly.

Sounds like we should update the documentation to let people know that they can use the conditions editor to accurately create such conditions, but let them know that in this specific case, the GUI display may be inaccurate, so they should double check the relevance equation to ensure they're getting what they expect.

lemeur

lemeur

2012-06-11 15:16

developer   ~19157

Last edited: 2012-06-11 15:17

Humm Weird.
Subquestions were dealt with like different questions.
This means that having both SQ1 == 'foo' with SQ1 == 'bar' must end up beeing ANDed and not ORed.

The only way to build such condition was to developp
(sq1 == 'A' or sq1 == 'B') and (sq2 == 'C' or sq2 == 'D')

===> (sq1 == 'A' and sq2 == 'C') OR (sq1 == 'A' and sq2 == 'D') OR (sq1 == 'B' and sq2 == 'C') OR (sq1 == 'B' and sq2 == 'D')
==> Where OR means "scenario"

So if the GUI lets you write the 1st condition this means that it was modifies by someone who forgot to update the VIEW panel.

To be honest I haven't had a look at the LS codebase since we migrate to Git so it is possible that I missed that.

Mazi

Mazi

2012-06-11 15:40

updater   ~19159

"Sounds like we should update the documentation to let people know that they can use the conditions editor to accurately create such conditions, but let them know that in this specific case, the GUI display may be inaccurate, so they should double check the relevance equation to ensure they're getting what they expect."

^- I think fixing the GUI would be a better approach :-)

Since it will be very irritating to the user to see the wrong conditions, we should definitely fix this.
Maybe Carsten can help...

c_schmitz

c_schmitz

2012-06-18 11:46

administrator   ~19300

Last edited: 2012-06-18 11:48

I can't see anything wrong done by the conditions editor. The conditions editor never supported the syntax that Thomas claims it should show.
AS Thibault already stated is that conditions on different subquestions are connectet always as 'AND'.

I would say that is an error in the EM conditions2EMsyntax conversion.

TMSWhite

TMSWhite

2012-06-18 13:07

reporter   ~19304

Carsten- Please take a look at the attached survey and screen shots. The problem is definitely with how the conditions editor is displaying certain complex conditions. It is ANDing together different sub-questions, but it is not ORing the options within sub-questions. I tested the exact same survey on 1.91+ and see the identical behavior.

c_schmitz

c_schmitz

2012-06-19 10:05

administrator   ~19335

yes, but that is how it was intended to work in 1.91+ and earlier versions.
If EM transcripts something different, then EM is not transcripting it correctly.

TMSWhite

TMSWhite

2012-06-19 13:21

reporter   ~19359

Carsten, I have to disagree. There must be an error in the conditions editor GUI. When you add the first one or two conditions, the logic looks fine. When you add the third, or try to do some of the conditions described in this and the linked bugs, the conditions editor display suddenly changes to show completely different logic. Then, if you delete or modify one of those conditions, the displayed logic changes again. There is no consistency in the errors generated by the GUI, so that is clearly a bug in the GUI, not EM's conversion process.

marcrichter

marcrichter

2012-06-20 14:33

reporter   ~19414

Guys, something is very wrong there, see the file I just uploaded (first question group). Build in 191 and broken in 192, mostly due to conversion from inappropriate "OR" to "AND".

Thanks for looking into this
Marc

TMSWhite

TMSWhite

2012-06-20 15:14

reporter   ~19416

Marc, which question(s), specifically, are broken?

marcrichter

marcrichter

2012-06-20 15:46

reporter   ~19417

Many thanks for the quick response!

My questions A1.x and A2.x depend on conditions against their predecessors A1 and A2, which get interpreted badly in release 1.92+ 120611 (which we installed this morning).

However, looking through related issues I think it's actually related to bug 6231, which was only solved less than two hours ago by a release incorporating the fix. Our admin will install the new version now and I'll re-check it on there. Will get back with results once I have them.

Kind regards
Marc

TMSWhite

TMSWhite

2012-06-20 15:52

reporter   ~19418

A1.x and A2.x look fine in 1.92+ 120620.

Since 120611 runs an bulk update on conditions and updates your database version to 155.5, you may need to re-run the bulk update process. Options are:
(1) set DBVersion to 155 in the lime_settings_global table and logout/login as administrator - that will re-run the conversion.
(2) Follow the instructions here - http://docs.limesurvey.org/Upgrade+hints+for+version+1.92#How_to_fix_this_problem_if_you_only_use_the_Conditions_Editor

marcrichter

marcrichter

2012-06-20 15:55

reporter   ~19419

FYI, the question between A1.x and A2 actually combines "AND" and "OR" (as does the final one following A2.x), so I suspect this may still be broken in today's release.

TMSWhite

TMSWhite

2012-06-20 16:11

reporter   ~19420

A1++ has this equation:

((is_empty(A1_a.NAOK)) and (is_empty(A1_b.NAOK)) and (is_empty(A1_c.NAOK)) and (is_empty(A1_d.NAOK)) and (is_empty(A1_e.NAOK)) and (A1_f.NAOK == "Y"))

A2++ has this equation:

((is_empty(A2_a.NAOK)) and (is_empty(A2_b.NAOK)) and (A2_c.NAOK == "Y"))

marcrichter

marcrichter

2012-06-20 17:12

reporter   ~19426

True, it's just a chain of "ANDs", sorry for the confusion.

Many thanks for your help and the hints! Our admin will give me the latest version tomorrow, looking forward to having this fixed - it got me a little stressed shortly before the survey release. :-)

c_schmitz

c_schmitz

2012-06-23 17:03

administrator   ~19516

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8852

c_schmitz

c_schmitz

2012-06-23 17:03

administrator   ~19517

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8853

c_schmitz

c_schmitz

2012-06-23 17:04

administrator   ~19518

Good things come to those who wait. :)

TMSWhite

TMSWhite

2012-06-24 02:11

reporter   ~19531

Looks good. Thanks.

c_schmitz

c_schmitz

2012-07-05 22:16

administrator   ~19627

New 1.92+ version released.

Related Changesets

LimeSurvey: Yii 76517950

2012-06-23 08:03:38

c_schmitz

Details Diff
Fixed issue 06188: Display error in conditions editor when selecting several options per sub-question Affected Issues
06188
mod - application/controllers/admin/conditionsaction.php Diff File

LimeSurvey: master 553774ae

2012-06-23 08:03:49

c_schmitz

Details Diff
Fixed issue 06188: Display error in conditions editor when selecting several options per sub-question Affected Issues
06188
mod - admin/conditionshandling.php Diff File

Issue History

Date Modified Username Field Change
2012-06-10 05:00 TMSWhite New Issue
2012-06-10 05:25 TMSWhite Note Added: 19142
2012-06-11 10:05 Mazi Assigned To => lemeur
2012-06-11 10:05 Mazi Status new => assigned
2012-06-11 10:06 Mazi Note Added: 19148
2012-06-11 13:23 TMSWhite Note Added: 19152
2012-06-11 13:23 TMSWhite File Added: limesurvey_survey_12345.lss
2012-06-11 13:25 TMSWhite File Added: conditions-editor-error.jpg
2012-06-11 13:28 TMSWhite Note Added: 19153
2012-06-11 13:28 TMSWhite File Added: conditions-editor-error2.jpg
2012-06-11 14:58 lemeur Note Added: 19155
2012-06-11 15:09 TMSWhite Note Added: 19156
2012-06-11 15:16 lemeur Note Added: 19157
2012-06-11 15:17 lemeur Note Edited: 19157
2012-06-11 15:40 Mazi Note Added: 19159
2012-06-11 15:40 Mazi Assigned To lemeur => c_schmitz
2012-06-11 19:05 TMSWhite Relationship added related to 06199
2012-06-18 11:46 c_schmitz Note Added: 19300
2012-06-18 11:48 c_schmitz Note Edited: 19300
2012-06-18 11:48 c_schmitz Assigned To c_schmitz => TMSWhite
2012-06-18 13:07 TMSWhite Note Added: 19304
2012-06-18 13:24 TMSWhite Assigned To TMSWhite =>
2012-06-18 13:39 TMSWhite Relationship added related to 06231
2012-06-18 16:52 TMSWhite Assigned To => c_schmitz
2012-06-18 16:53 TMSWhite Relationship added related to 06234
2012-06-19 10:05 c_schmitz Note Added: 19335
2012-06-19 13:21 TMSWhite Note Added: 19359
2012-06-20 14:32 marcrichter Issue Monitored: marcrichter
2012-06-20 14:32 marcrichter File Added: caselaw_191vs192.lss
2012-06-20 14:33 marcrichter Note Added: 19414
2012-06-20 15:14 TMSWhite Note Added: 19416
2012-06-20 15:46 marcrichter Note Added: 19417
2012-06-20 15:52 TMSWhite Note Added: 19418
2012-06-20 15:55 marcrichter Note Added: 19419
2012-06-20 16:11 TMSWhite Note Added: 19420
2012-06-20 16:22 TMSWhite Relationship added related to 06240
2012-06-20 16:44 TMSWhite Relationship deleted related to 06240
2012-06-20 17:12 marcrichter Note Added: 19426
2012-06-23 17:03 c_schmitz Changeset attached => LimeSurvey Yii 76517950
2012-06-23 17:03 c_schmitz Note Added: 19516
2012-06-23 17:03 c_schmitz Resolution open => fixed
2012-06-23 17:03 c_schmitz Changeset attached => LimeSurvey master 553774ae
2012-06-23 17:03 c_schmitz Note Added: 19517
2012-06-23 17:04 c_schmitz Note Added: 19518
2012-06-23 17:04 c_schmitz Status assigned => resolved
2012-06-23 17:04 c_schmitz Fixed in Version => 1.92+
2012-06-24 02:11 TMSWhite Note Added: 19531
2012-06-24 02:20 TMSWhite Relationship replaced has duplicate 06234
2012-07-05 22:16 c_schmitz Note Added: 19627
2012-07-05 22:16 c_schmitz Status resolved => closed
2021-08-02 18:36 guest Bug heat 16 => 18