View Issue Details

IDProjectCategoryView StatusLast Update
05905Development Otherpublic2012-08-14 22:44
ReporterFredAssigned ToTMSWhite 
Status closedResolutionno change required 
Product Version1.92RC2 
Target VersionFixed in Version 
Summary05905: Inserting "null" on relevant, optional questions
DescriptionWhen a question is not "relevant" because of conditions or relevance equation, it is never posed to a user, and Limesurvey inserts a <NULL> in the response column for the current row.

In cases where a question IS relevant, is non-mandatory, and the user does not answer, Limesurvey is supposed to insert a zero-length string in the response column for the current row. This distiguishes a "no answer" from a "non-relevant."

This works correctly for list questions, multi-choice, and text questions. But for numeric questions, it is inserting a <NULL> when user skips a relevant, non-mandatory question.

Steps To ReproduceCreate a numeric or multi-numeric question.
Make sure it is not mandatory
Run the survey and skip the question
Look at the database and check the record.
It will show <NULL> rather than empty
Additional InformationI checked and this works the same way in 1.91, so it must be a long-standing issue. Maybe there is a reason, but it does not seem consistent. There is no way for us to distinguish non-responses from non-relevants when exporting the data.
TagsNo tags attached.




2012-03-14 06:20

reporter   ~17912


I found a comment in the code about this (for 1.91, 1.92, and 2.0). Whenever a numeric or multple numeric is blank, we intentionally write NULL to the database. The stated reason is:
"some databases can't store blanks in numerical inputs"

For example, if you try to use PhpMyAdmin to store a blank in a float field, it sets the value to 0, which is not what we want.

Of course, yet another option would be to just store numbers are varchar(), but that would probably require changes to the statistics module.

So, for now, you can't tell the difference between irrelevant and unanswered questions for numeric and multiple numeric.


2012-03-14 16:42

reporter   ~17918

Thanks Tom. I had a feeling that there was probably a reason and that changing it could bring about all types of unintended consequences. Definitely would not want zeros in there. In our database we just check of a "NO-RESPONSE" flag to indicate an empty response, as opposed to a non-relevant.

In any case, it isn't critical with numerics because we aren't doing frequency distributions that need to add up to 100% after accounting for relevance. So we can just throw out NULL numerics and do processing with what we have.


2012-03-14 16:45

reporter   ~17919

As discussed, this is the expected behavior for numeric question types.

Issue History

Date Modified Username Field Change
2012-03-13 18:23 Fred New Issue
2012-03-14 06:20 TMSWhite Note Added: 17912
2012-03-14 16:42 Fred Note Added: 17918
2012-03-14 16:45 TMSWhite Note Added: 17919
2012-03-14 16:45 TMSWhite Status new => resolved
2012-03-14 16:45 TMSWhite Resolution open => no change required
2012-03-14 16:45 TMSWhite Assigned To => TMSWhite
2012-08-14 22:44 c_schmitz Status resolved => closed