NUBIC/nu_surveyor — pull request #96 by jdzak (2012-12-05 23:49:29+00:00)
Title: Condition >= fails when no response exists

When you have a >= condition where there is a response for a answer other than what the condtition is written for, an out of bounds exception is thrown.

To reproduce with the survey below:
1. Select "Don't Know"

{
"sections": [
{
"display_order": 0,
"questions_and_groups": [
{
"answers": [
{
"text": "NUMBER",
"type": "integer",
"uuid": "ebd4d920-8ff0-4c7e-ac80-27ef63c41a87"
},
{
"text": "DON'T KNOW",
"uuid": "053a3eae-206b-45bc-900d-32e0105773a2"
}
],
"pick": "one",
"text": "How many?",
"uuid": "e2bfb591-5528-4813-841b-6b93a8537b1d"
},
{
"answers": [
{
"text": "NUMBER",
"type": "string",
"uuid": "59a12455-ca26-4ffe-8f8f-331ae0b43d85"
},
{
"text": "DON'T KNOW",
"uuid": "cd89c38c-2526-457e-823d-443716c56590"
}
],
"dependency": {
"conditions": [
{
"answer": "ebd4d920-8ff0-4c7e-ac80-27ef63c41a87",
"operator": ">=",
"question": "e2bfb591-5528-4813-841b-6b93a8537b1d",
"rule_key": "A",
"value": 1
}
],
"rule": "A"
},
"pick": "one",
"text": "That's a lot",
"uuid": "f85b5186-b5e9-4f14-a919-e91bf1589b9c"
}
],
"title": "One"
}
],
"title": "Condition >= Test"
}