Watts-Lab/surveyor

Required not working with checkboxes

Closed this issue · 37 comments

Required checkbox is not working.

@markwhiting @TutiGomoka
The problem here is that making all checkbox required, means that all the checkboxes need to be clicked. So, some js script has to be written for this element. I likely don't have time to complete this before Monday, since I have to priortize writing more documentation.

        - main = answer.substring(1)
        - id = (main+item.name).replace(/ /g,'')
        input(type='checkbox' role='checkbox' name= item.name id= id value= main)                            
        //- script.
        //-   document.addEventListener("DOMContentLoaded", function(event) { 
        //-     var n  = document.getElementById(id);
        //-     console.log(n);
        //-   });
        //-   if n.checked {
        //-     check = true;
        //-   }
        //- if check
        //-   input(type='text' name=item.name placeholder='Type your answer' required= req)
        label(for=id)= main

@markwhiting; what do you think?

Checkbox requirement is a bit tricky (even things like Qualtrics don't do a great job for it). I think I would just leave it off and assume that some people might enter no value for those questions.

Let's leave this open as wishlist but not worry about it for now?

OK; but don't you think it's costly that we are collecting Demographics surveys for all these people yet within each survey we collect, one variable 'doesn't work'? Also think about this in terms of the kind of research people might want to use the panel for e.g. political questions in PennMap where demographics variables are kinda important?
And so how will we rectify this in the future? Re-sent demographics surveys just to get that one variable whose checkboxes doesn't work?

@sumants-dev Is there another way to collect information similar that doesn't involve multiple checkbox i.e. an "other" box that allows people to enter additional races they identify with?

Don't make it a checkbox and change it to radio button so only one option can be selected. Required for radio buttons works appropriately. And put an option called two or more races

Mmh... I'm sort of thinking we can have a 2 questions on race/ 2 part question on race. First question asks what race they identify as and then the second one asks any additional race to the one above that they identify with. I think for the time being this will help us better collect information on this variable which is a kind of important for some of research done at this Lab.

Done! Just made the change. Forgot to mention this issue. See it here. If someone identifies as more than 2 races; we are just going to have to add that functionality later.

I don't think this is a great solution because it also imposes a limit. Many people who identify with more than one race, also identify with more than two.

I think either using the other input or a required radio with an option like "more than one race" and a non required text field to allow people to enter information about the races they identify with is stronger.

I've personally never met someone who identifies as more than 2 races. I find it even remarkable (though very much good + needed) that we are allowing multiple options in a survey like this. Most US surveys I've filled out don't.

Do we have the option of implementing an 'Other _______' option? If so, great.

My key issue here is I don't want to give people the option of just selecting an "other" or "more than one" and not telling us what that "other"/more than two/all their races is(are).
I think it's best for every person we have as much information as possible.

Perhaps in the race_two category we can have an option of "More than two races " instead of "other"

@karansampath — is other ready? (#48) It looks like we will need it soon.

@TutiGomoka for the time being, let's hold just the single race option we previously had to avoid getting inconsistent data around this until we can transition to something that can be a long term solution. I agree with it's importance.

So we previously had a multi-race option - which is what was causing the NULL problem. Should I now change it to radio/single race option with the same array of options?

Was it always NULL or only if someone didn't select anything? If the latter (i.e., some NULL and some not), what portion of NULL was it? (i.e., people who didn't answer that question / all the people who answered another required question in the same instrument)

(sorry if you've been over this before and I missed it)

See here/ the csv file below. There are many instances of people answering all the other questions (all of which were required) in the Demographics Survey. But only their race response appears as NULL to us.
demographics_test_20.csv

So I was thinking they answered the race question; but there is a bug concerning the multi-tick option on our end, and so we see it as null - and Sumant seemed to confirm that.

OK, just to make sure I understand,

  1. Why or how are there NA's on that sheet on other questions?
  2. Is the bug with the checkbox question just that it wasn't required or is it more specific, e.g., data from that question wasn't being recorded even if they did respond?
  3. If the issue is about not responding, i.e., some people didn't respond and their data appears null, for what portion of respondents to this survey is this true? As in, what percent are not answering the question?

Thanks. Good to know.

Mark;

The sheet I sent was for select IRCS and Demographics variables for an observation queried from the surveyor responses. If it's NAs for the other responses it means they weren't doing that other survey. i.e. responses that are not NA for income; marital status; will not have a response for different_problem_advice because that's an IRCS variable.
What I looked for was that people who were doing demographics had all their demographics variables except race which was NULL leading me to believe it was a bug on our end because we can't support multi-box functionality

Thanks, got it. And what percentage of people who were asked to answer the race question are not answering it over all the time's we have asked it with this survey so far?

Well - I was looking at this last test of 20 people. And they seemed many in that sample so I thought it could have been a recent problem.

I'm just wondering what the percentage is overall so I can get a sense for the scale of the problem. Like out of all our data collected, how often is this happening.

It would also be interesting to know how often people are registering different combinations of race in their response.

Could you share a table that looks at people who have responded to this demographics survey (not people from whom we got demographics data as given data), and group by the response to this question and show summary counts and percentages of the population for each group?

Screen Shot 2022-05-09 at 10 27 43 AM

This is what it looks like when I do:

internal_data %>% 
       filter(grepl("demographics", SurveyName, ignore.case = T))%>% 
       select(race) %>% 
       group_by(race) %>%
       summarise(x = n())

But this is what it looks like for people who we just sent demographics surveys to people in the test of 20 people.

Screen Shot 2022-05-09 at 10 31 35 AM

OK. Let's stick with the checkbox for now, and we can work out a fix for checkbox required as an issue with the summer team.

Notably, one person has two demographic results there. Any idea whats going on with that? How is that possible? (don't links lock after they have been completed)

It might have happened that we surveyed them in the past and got their demographic result. And .... and here might be an implication of this problem that I might need to change the script:

In the HT_panel_completion.R, I've set it up so I consider someone as having completed our demographics survey when the race variable is not NA. Why? because we said we want to mark that survey completed only if they did our demographics survey and not based on responses from previous donated data that include demographics.
And race is the only variable we added to our own instrument that didn't exist in previously donated data.

And so it looks like this person (ID ending in VCM), was surveyed on 23rd April and said NULL for race. My script (based on the way it was designed) said they hadn't completed the demographics survey and sent it to them again last week - to which they then replied that they're White

Screen Shot 2022-05-09 at 10 43 43 AM

So let me know:
It's probably a good idea to make the basis of completion of our demographics survey a bit broader?

Yeah, sounds good! Perhaps check for a few of the questions that are known required.

Also, it looks like some of these people input birth year incorrectly. Perhaps thats another thing for us to make an issue for (i.e., so they can't submit surveys that have impossible birth years).

But then don't you like the idea of forcing people to answer our questions haha. We eventually got a complete survey from them. It just took two tries.
But I will make it so that if more than x number of questions are answered then demographics is complete.

I think we might have a problem with that birth_year question. @sumants-dev; can we require that the response in that box be both numeric and have 4 digits between 1915 to today?

I think we need a slightly more general approach for required for these kinds of situations. i.e., we need a way to specify in the survey how required should work in different inputs.

So for example, we could use the required column in some way so as to encode validations for various things. For this checkbox we might require something like "at least 1 response", but in a different survey we might want "at least 3 responses" (e.g., "Select your 3 favorite flavors of ice cream?").

But on the multi-box race question @markwhiting, just to clarify:

OK. Let's stick with the checkbox for now, and we can work out a fix for checkbox required as an issue with the summer team.

By this do you mean we leave it as it was before? Multi-checkbox option, someone can select more than one race option? Even though we know that our functionality may allow them to skip that question?
And so: shouldn't we, in the meantime, find a way to still require them to answer the question. For example, I could add a sentence in the message notification that they must answer all questions if they want to be paid.

I think we need a slightly more general approach for required for these kinds of situations. i.e., we need a way to specify in the survey how required should work in different inputs.

So for example, we could use the required column in some way so as to encode validations for various things. For this checkbox we might require something like "at least 1 response", but in a different survey we might want "at least 3 responses" (e.g., "Select your 3 favorite flavors of ice cream?").

Do you mean this as a comment next to the question? Telling them what their responses should look like

And so: shouldn't we, in the meantime, find a way to still require them to answer the question. For example, I could add a sentence in the message notification that they must answer all questions if they want to be paid.

Yep that seems fine, but let's still pay them if they don't fill it out. If people really don't want to answer, thats ok haha.

Do you mean this as a comment next to the question? Telling them what their responses should look like

No, I mean as a more general technical solution. Putting text can also help in the mean time. I just made an issue for the more general problem here → #107

OK -
So I guess now that we have decided on this checkbox problem, we can move forward with fifth wave?

Yep! I think this can be closed if all is set up.

Did we need to adjust the survey back?

Yup. Changed it back!

Thank you

I will just the shift the messaging to remind people to try and finish all questions (and pay them regardless). Meanwhile hopefully this summer we can get that Other ____ box + fix this multi-option checkbox thing working