Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

issue with count(option1,option2,option3,..etc)

  • Bigred01
  • Bigred01's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
8 years 7 months ago #123443 by Bigred01
Hey everyone.

Our main lime running is an older version (Version 2.05+ Build 141020) and I recently had an issue of missing data connected to the count() function.

In the older version state above, I had a multiple choice question (q2) that showed if TOKEN:ATTRIBUTE_1 == "1". A question near the end of the survey showed if ((count(q2_1,q2_2,q2_3,q2_4,...etc) < 2)). The logic appeared to work fine during tests. The question showed when needed, was skipped when it wasn't. What we didn't realize though is if question 2 wasn't asked, the data for this question was not saved, yet it still showed (as intended) and got past the mandatory check.

After we noticed the missing data, I confirmed the question was set to mandatory and during testing, after pressing previous the page would load without the question answered. After removing count() and using a different approach, the data saved fine. So unless question 2 was asked, regardless if the question with the skip logic showed and was set to mandatory, it did not actually save the data. I tried other variations of the logic but regardless of what was paired with it as an "or", the data never saved unless q2 was asked.

I set this up in the newest version of lime and no matter what I used as an "or" statement, the question would even not show which would never have gotten past testing, and the logic would have been changed. Which leads me to speculate that this issue may have been noticed previously and this was added as the fix. I wasn't able to find anything on the issue I experienced in the older version or the behavior in the most recent version so I just wanted to check in here to see if anyone remembers anything about this issue in older versions of lime and if the most current logic is working as intended. If there's a bug here, ill submit to the bug tracker.
The topic has been locked.
More
8 years 7 months ago #123445 by jelo
Perhaps a different setting ? deleteonvalues?
$deletenonvalues: Use this feature with caution. By default (a value of 1), irrelevant questions are NULLed in the database. This ensures that the data in your database is internally consistent. However, there are rare cases where you might want to hold onto irrelevant values, in which case you can set the value to 0. Say you ask the person his gender, and he accidentally says 'female' and then answers some female-specific questions (questions that are conditioned on being female, so are only relevant for women). Then, he realizes his mistake, backs up, sets the gender to 'male', and continues with the survey. Now, the female-specific questions are irrelevant. If $deletenonvalues==1, those irrelevant values will be cleared (NULLed) in the database. If $deletenonvalues==0, his erroneous answers will not be deleted, so they will still be present in the database when you analyze it.

bugs.limesurvey.org/view.php?id=8647

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose