instedd / surveda

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

QuotaBucket: Show single value when single-value-range #2325

Closed anaPerezGhiglia closed 2 months ago

anaPerezGhiglia commented 2 months ago

for #2318

anaPerezGhiglia commented 2 months ago

@matiasgarciaisaia the thing is that the definition should have been 18,50,51,80

The "inverted" bucket is still an issue, but the single-value bucket seems to work ok

image
matiasgarciaisaia commented 2 months ago

Inverted would be solved by sorting the input before processing, right?

We should write a ton of test cases for this, though - should be easy.

anaPerezGhiglia commented 2 months ago

Inverted would be solved by sorting the input before processing, right?

Not quite. The values are being sorted already. The thing is that the input has two cutoffs that are the same (50, 50). The thing is how ranges are being defined. The upper bound of the ranges is being defined as next_lower_bound - 1 So, the range "between 50 and 50" turns out to be 50 - 49. I think that the way of solving this is removing duplicated cutoffs before generating the ranges