instedd / surveda

InSTEDD Surveda
https://instedd.org/technologies/surveda-mobile-surveys/
GNU General Public License v3.0
17 stars 6 forks source link

Integer variable quota buckets should be exhaustive #2318

Closed matiasgarciaisaia closed 4 months ago

matiasgarciaisaia commented 7 months ago

We've seen #1471 happen time and time again: when using quotas, if a respondent doesn't match any of the existing quotas, the survey progress calculation gets broken.

When setting the quota buckets (as of 0.37.2), Surveda asks the survey editor for the buckets limits of integer variables, and creates ranges between them. For example, for an Age variable with range 0-110, the delimiters 18,30,45,100 yield the buckets 18-29, 30-44, 45-100. The values <18 and >100 don't belong to any bucket.

Instead, Surveda should guarantee every value belongs to a bucket, creating extra buckets for the values below the minimum delimiter, and above the maximum. So, in this case, the resulting buckets should be <18, 18-29, 30-44, 45-100, >100.

We should probably avoid making the implicit boundaries of the intervals explicit (ie, make the first bucket 0-17) because they can change in the quex before the survey is started (and, also, because the user doesn't care about them - if they would care, they would include that value as a delimiter).

manumoreira commented 5 months ago

I've been testing this feature here https://surveda-stg.instedd.org/projects/383/surveys/4202 and it seems like there's something not working as expected with the quota buckets, I'll explore further.

anaPerezGhiglia commented 4 months ago

The misbehavior reported by Manu in the previous message is not related to this issue so I'm closing it