View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
06139 | Bug reports | Conditions | public | 2012-05-27 15:21 | 2012-06-07 11:04 |
Reporter | Mazi | Assigned To | c_schmitz | ||
Priority | normal | Severity | partial_block | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.92+ | ||||
Target Version | 1.92+ | ||||
Summary | 06139: EM doesn't convert condition correctly, AND becomes OR | ||||
Description | When creating a condition using the condition editor like "Show question X IF question Y = Yes AND equestion_question == '0' (constant value)" EM doesn't convbert the condition correctly and shows an OR connector between the two questions. See attached screen shots. | ||||
Steps To Reproduce |
| ||||
Additional Information | Additional note: All pages having questions which are having a condition based on the equation question (first question of group "Demographics 2") don't show the progress bar correctly. Can you reproduce this? | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 8 | ||||
Complete LimeSurvey version number (& build) | 120525 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Firefox 12 | ||||
Database type & version | MySQL | ||||
Server OS (if known) | ? | ||||
Webserver software & version (if known) | ? | ||||
PHP Version | ? | ||||
I'm not sure if this is related: When using EMs rand() function to create a random integer number and then applying conditions to it, do i have to use ?!? |
|
(equationQuestionCode == "1") should be fine (but you can also use the number). Strings that are numbers are automatically cast to numeric. |
|
Mazi- When I import this survey, it shows an error for the relevance. The first randnumber.NAOK is shown as the SGQA code (e.g. it isn't recognized on import). When I manually edit the condition to fix that problem, the generated equation is correct: ((car_owner.NAOK == "A1") and (randnumber.NAOK == "0")) or ((home_owner.NAOK == "A1") and (car_owner.NAOK == "A1") and (randnumber.NAOK == "1")) So, I can't reproduce this yet. However, oddly, I do see the problem relevance equation within the .lss file. Perhaps there is also an import problem since the variable is declared within the same group that the condition is used. Although, I haven't seen that problem before either. |
|
Hi Tom, I have tried to reproduce the problem but whatever I tried, it now shows up correctly. I wonder how I managed to get this done so it convert from, maybe it was just my fault. nevertheless you are right, there is a problem at import. The GSQA value for the question question isn't converted correctly, see attached screenshot. |
|
The import is working correctly. There seems to be an error in the source database: <row> Note the invalid cfieldname, if should end with 3626. Question is how that happened in the first place? How old is that database, which versions were used to edit it? Why are there duplicate question codes at all? (randnumber?) |
|
You can see the error in the first of Mazis screenshots, too. Since this is so hard to reproduce, I suggest we close this matter until someone finds how how exactly to reproduce it. |
|
Carsten, this survey was created on Limeservice (account: http://actions.limequery.com/admin). The database is pretty fresh. There is just one test survey and this one. Tom/Carsten: Since this is an important survey that should go live soon, do you recommend to delete the equation question and re-create it? @Tom, using the attached survey, can you reproduce the error that the progress bar doesn't work correctly on some pages? |
|
I remember there was an error in the conditions editor a little time ago. |
|
Do I have to re-create the conditions at all for technical reason or to be sure that it all works well? Because I thought that when using question codes and relevance only (no condition editor), there is no reference to any question ID anymore but only the code is used? |
|
Mazi- To recreate the relevance from conditions, you can either re-import the survey, or use the EM menu tool to convert conditions to relevance for the entire survey. Then check the Show Logic file for any errors. As long as there are no errors, the survey should be fine. |
|
I mean only the conditions where you are using the conditions editor and that don't work as intended. |
|
Tom, one more general question since I'm trying to debug some other odd behavior: if there is a question with some customized JS at the first question of a group at a survey run in group by group mode, when does EM process that JS?
Different topic (but I wanted to ask before creating a bug report): Did you notice any odd/different behavior when using the rand() function inside an IF statement which refers to previous questions at an equation question if you run it in group by group or all in one mode? |
|
Mazi- Custom JS will probably run regardless of when EM does it processing. EM gets called (via checkconditions) at load time, and then every time a value is changed. When custom JS gets called depends on when it gets loaded relative to document.ready(). I'm not an expert on that stuff. So, I recommend you pick some sample use cases and use FireBug to step through the code and see when the custom JS is called. Bottom line is that EM doesn't try to encapsulate custom JS to prevent it from being called except for situations where the question is relevant. I didn't try your custom rand() functions. However, if they are part of relevance or EM in general, rand() will be called multiple times, which often isn't what you want. So, see this example, which ensures that rand() is only called once. http://docs.limesurvey.org/Expression+Manager+Sample+Surveys#Randomly_Ask_One_Question_Per_Group /Tom |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2012-05-27 15:21 | Mazi | New Issue | |
2012-05-27 15:21 | Mazi | Status | new => assigned |
2012-05-27 15:21 | Mazi | Assigned To | => c_schmitz |
2012-05-27 15:21 | Mazi | File Added: limesurvey_survey_19966 - EM condition conversion bug.lss | |
2012-05-27 15:21 | Mazi | File Added: condition editor.PNG | |
2012-05-27 15:21 | Mazi | File Added: em_syntax.PNG | |
2012-05-27 15:31 | Mazi | Issue Monitored: Mazi | |
2012-05-27 15:31 | Mazi | Issue End Monitor: Mazi | |
2012-05-27 15:31 | Mazi | Issue Monitored: TMSWhite | |
2012-05-27 15:33 | Mazi | Note Added: 18920 | |
2012-05-27 15:41 | TMSWhite | Note Added: 18921 | |
2012-05-27 16:27 | TMSWhite | Note Added: 18922 | |
2012-05-28 14:13 | Mazi | Note Added: 18939 | |
2012-05-28 14:13 | Mazi | File Added: sgqa_conversion_equation.png | |
2012-05-28 14:14 | Mazi | File Added: sgqa_admin_interface.png | |
2012-05-28 14:21 | c_schmitz | Note Added: 18940 | |
2012-05-28 14:21 | c_schmitz | Status | assigned => feedback |
2012-05-28 14:24 | c_schmitz | Note Added: 18941 | |
2012-05-28 14:25 | c_schmitz | Note Edited: 18941 | |
2012-05-28 14:59 | Mazi | Note Added: 18942 | |
2012-05-28 14:59 | Mazi | Status | feedback => assigned |
2012-05-28 14:59 | Mazi | File Added: progres_bar.png | |
2012-05-28 15:02 | c_schmitz | Note Added: 18943 | |
2012-05-28 15:03 | c_schmitz | Note Edited: 18943 | |
2012-05-28 15:10 | c_schmitz | Status | assigned => closed |
2012-05-28 15:10 | c_schmitz | Resolution | open => unable to reproduce |
2012-05-28 15:12 | Mazi | Status | closed => feedback |
2012-05-28 15:12 | Mazi | Resolution | unable to reproduce => reopened |
2012-05-28 15:14 | Mazi | Note Added: 18962 | |
2012-05-28 15:14 | Mazi | Status | feedback => assigned |
2012-05-28 15:14 | Mazi | Status | assigned => resolved |
2012-05-28 15:14 | Mazi | Resolution | reopened => fixed |
2012-05-28 15:20 | TMSWhite | Note Added: 18963 | |
2012-05-28 15:20 | c_schmitz | Note Added: 18964 | |
2012-05-28 20:10 | Mazi | Note Added: 18976 | |
2012-05-28 20:32 | TMSWhite | Note Added: 18977 | |
2012-06-07 11:04 | c_schmitz | Status | resolved => closed |