Closed LWest001 closed 1 year ago
Not sure if this is based on the dummy survey we looked at or whether this is something from the UI component. At present, we have explicit separate “if other, please specify” questions. Originally, the idea was that we had questions like: What type of heating system? (Forced hot air/Radiators/Other), then a separate question with “if other, what”?
If the UI is smart enough to handle showing a separate text box for other, I think we'd be fine to remove the separate question – ultimately in the database, we store survey_answers
with a text answer
field – so if the recipient picks “forced hot air”, we'll store that, and if they select “Other” and then write another response, we could store that instead.
Not sure if this is based on the dummy survey we looked at or whether this is something from the UI component. At present, we have explicit separate “if other, please specify” questions. Originally, the idea was that we had questions like: What type of heating system? (Forced hot air/Radiators/Other), then a separate question with “if other, what”?
If the UI is smart enough to handle showing a separate text box for other, I think we'd be fine to remove the separate question – ultimately in the database, we store
survey_answers
with a textanswer
field – so if the recipient picks “forced hot air”, we'll store that, and if they select “Other” and then write another response, we could store that instead.
@mikelynch I like that idea. In that case, is this an issue that can be handled on the backend and we can leave the UI the same?
I think so – so basically the survey would something like:
{
"id": 1,
"title": "Draft Survey",
"survey_questions": [
…,
{
"id": 10,
"display_order": 10,
"text": "So we can report back on your potential savings, what type of heating system do you have? (Across the whole home, not just in individual rooms)",
"response_type": "radio",
"response_options": [
"Forced hot air – vents",
"Radiators – water",
"Radiators – steam",
"Basebaord – water",
"Baseboard – electric",
"Other"
]
}
]
}
and then your JS would detect that there was an "other" option, and show the second box. In the response, the front end would submit something like (note this is nested within a survey visit, but I'm doing this off the top of my head and not looking it all up):
{
"survey_id": 1,
"survey_answers": [
{
"survey_question_id": 10,
"answer": "Forced hot air – vents"
}
]
}
or if they did Other
something like:
{
"survey_id": 1,
"survey_answers": [
{
"survey_question_id": 10,
"answer": "Jumping up and down"
}
]
}
@LWest001 , does that make sense?
@mikelynch Yes it does.
@mikelynch can I assign this issue to you?
I didn't think this required anything on the backend, no? Happy to clean up the dummy questions to remove the “if other, please specify”, but I think the rest is frontend logic.
Right now the UI pulls up an "other" field when an "other" option is selected (as intended), so I think we just need to remove the "if other, please specify" from the survey questions. I may have misunderstood your previous comment!
As far as I know, we don't have the “real“ (i.e. final) survey questions – I just put together some dummy ones. Happy to remove those extra questions but we probably need to update them all anyway.
As far as I know, we don't have the “real“ (i.e. final) survey questions – I just put together some dummy ones. Happy to remove those extra questions but we probably need to update them all anyway.
Gotcha. I think we can just close the issue for now and keep it in mind when we put the final surveys together!