View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
08832Bug reportsExpression Managerpublic2014-06-11 16:30
Reportermfaber Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Summary08832: Relevance not observed (questions dependent on LATER matrix question with exclusive option)
Description

OK, here's a weirdo that i finally was able to boil down to a test case:
Questions depending on a disabled subquestion (due to exclusive option) only get hidden (relevance is observed) if question comes after but not before the matrix question.

See step by step and attached lss.

Relevance logic works oddly enough for saving only relevant values but does not work to display only relevant questions

Steps To Reproduce

Load the attached lss.
activate! (we need to look at recorded answers)
Run!

In the matrix question choose Yes for "Bananas"
--> Q1 and Q2 before and after the matrix question appear
Choose Yes on both Q1 and Q2

Now choose Yes for Apples in matrix (exclusive option)
--> Bananas and Cherries get disabled, so far so good.

Problem: Now, only Q2 disappears. Q1 stays. Even though both have the same relevance equation, depending on matrix_2 (Bananas).

Press submit and have a look at the recorded responses in response browser
--> Answers do not get recorded for Q1 (which is correct because the question should not be relevant but users may expect shown results to also be recorded).

TagsNo tags attached.
Attached Files
relevance_bug_8832.lss (17,046 bytes)
Bug heat6
Complete LimeSurvey version number (& build)20140309
I will donate to the project if issue is resolvedNo
BrowserFF
Database type & versionMySql 5.6.14
Server OS (if known)Win7
Webserver software & version (if known)Apache 2.4.7
PHP VersionPhP 5.4.19

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2014-03-18 15:56

administrator   ~29346

Relevance based on questions after the current question is currently not well supported.

This is also obvious if you move the first question to a different group that appears before the first group. It will always be shown. (and a proper error is shown by 'show logic'). You could make it work on the same page somehow but then you have a differing behaviour to the 'different group' scenario.

However in this case it seems to be a propagation JS issue. When following your instructions in the survey and activatning the exclusive option and then click the disabled 2nd row in the matrix question, then the 1st question suddenly disappears.

tpartner

tpartner

2014-04-21 21:39

partner   ~29836

Carsten, I'm afraid I'm stumped on this one. I've spent a lot of time trying to unravel em_manager_helper.php and really can't see a way around this.

My recommendation would be to say "relevance and conditions can only be based on preceding question(s)".

c_schmitz

c_schmitz

2014-04-23 12:51

administrator   ~29867

Tony, can you spot the error in the JS on the page? If yes maybe you can show it to me and I will unravel em_manager_helper.php for you ;).

tpartner

tpartner

2014-04-23 12:57

partner   ~29868

No, that's the problem - I don't see any obvious errors.

TMSWhite

TMSWhite

2014-04-23 18:21

reporter   ~29871

Another option might be to keep the current functionality, since it "works as designed", but update the documentation to strongly recommend only basing branching on variables that occur on the same or prior pages. Also update it to explain that the color coding in the Show Logic File feature displays variables in a different color if they are on the prior, same, or future page. This way an author can tell if that has happened.

Personally, I sometimes put equation variables at the end of the survey, and use variable assignment (the single equals operator) to change their values and branch based upon those changed values (such as maintaining counters of answered + verified questions). It is possible, and probably more robust, to always compute the full equation. However, the use-case I was tackling was an hour long diagnostic interview where we needed to ask the minimum number of questions needed to rule in or rule-out the each diagnosis. The full equation would have had a hundred+ variables, so it was easier to read and maintain with counters.

So, 99% of users should not base their relevance equations on values set on future pages, but there are few rare cases where it can be helpful.

tpartner

tpartner

2014-04-23 18:49

partner   ~29872

I agree, but in this case everything is on the same page so we may need to change that to "only basing branching on variables that occur in preceding pages or questions".

c_schmitz

c_schmitz

2014-06-11 16:30

administrator   ~30082

Updated documentation

Issue History

Date Modified Username Field Change
2014-03-09 23:44 mfaber New Issue
2014-03-09 23:51 mfaber File Added: relevance_bug_8832.lss
2014-03-10 12:22 DenisChenu Relationship added related to 08823
2014-03-10 12:27 DenisChenu Relationship deleted related to 08823
2014-03-18 15:56 c_schmitz Note Added: 29346
2014-03-18 15:57 c_schmitz Assigned To => tpartner
2014-03-18 15:57 c_schmitz Status new => assigned
2014-04-21 21:39 tpartner Note Added: 29836
2014-04-21 21:39 tpartner Assigned To tpartner => c_schmitz
2014-04-23 12:51 c_schmitz Note Added: 29867
2014-04-23 12:51 c_schmitz Status assigned => feedback
2014-04-23 12:57 tpartner Note Added: 29868
2014-04-23 18:21 TMSWhite Note Added: 29871
2014-04-23 18:49 tpartner Note Added: 29872
2014-06-11 16:30 c_schmitz Note Added: 30082
2014-06-11 16:30 c_schmitz Status feedback => closed
2014-06-11 16:30 c_schmitz Resolution open => fixed