episphere / quest

experimenting with the idea of a questionnaire markup
https://episphere.github.io/quest/
2 stars 11 forks source link

Error when using 77, 88, 99 in a multi-select that includes a textfield #320

Closed stealthv closed 3 years ago

stealthv commented 3 years ago

If you have a multi-select question (checkboxes) and

Then when you select the 77 answer an exception is shown in the console. Also, checking this value in a later question will not work properly

Example:

[START]
Let's go

[Q1]
Select all that apply
[0] Option 0
[1] Option 1
[2] Option 2
[3] Other |__|OTHER_OPTION|
[88] None of the above

[RESULTS]
|displayif=equals(Q1,0)|You selected option 0|
|displayif=equals(Q1,1)|You selected option 1|
|displayif=equals(Q1,2)|You selected option 2|
|displayif=equals(Q1,3)|You selected other option|
|displayif=equals(Q1,77)|You selected none of the above|

[END]
All Done.

I am not aware of a workaround besides removing the text field.

hzhao392 commented 3 years ago
[START]
Let's go

[Q1]
Select all that apply
[0] Option 0
[1] Option 1
[2] Option 2
[3] Other |__|OTHER_OPTION|
[99] None of the above

[RESULTS]
|displayif=equals(Q1,0)|You selected option 0|
|displayif=equals(Q1,1)|You selected option 1|
|displayif=equals(Q1,2)|You selected option 2|
|displayif=equals(Q1,3)|You selected other option|
|displayif=equals(Q1,99)|You selected none of the above|

[END]
All Done.

@kundan22197 seems like this is missing a null check for line 442 that you changed. Please take a look at this line and any other lines similar to this

kundan22197 commented 3 years ago

Fixed