android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

Add asterisks symbol for Required fields in Questionaire

Open Manikant25 opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. No this is just an enhancement.

Describe the solution you'd like Asterisks symbol can be added for the fields which have an attribute "required": "true". * indicates required fields as seen in the sample below.

Screenshot 2021-06-11 002613

Describe alternatives you've considered NA

Additional context NA.

Would you like to work on the issue? Yes

Manikant25 avatar Jun 10 '21 19:06 Manikant25

@jingtang10 If you like the feature, then may I start with it.

Manikant25 avatar Jun 10 '21 19:06 Manikant25

#470 ?

epicadk avatar Jun 11 '21 03:06 epicadk

#470 ?

#470 does not show an asterisk for required fields.

Manikant25 avatar Jun 12 '21 06:06 Manikant25

@Manikant25 thanks for raising this - this is now an urgent need from two implementers.

@Manikant25 please feel free to send a pr asap - if you don't have time @santosh-pingle will work on this.

jingtang10 avatar Sep 22 '22 09:09 jingtang10

sure, I will try to send the PR by the end of this weekend.

Manikant25 avatar Sep 22 '22 10:09 Manikant25

@shelaghm can you please comment on the UX design of this issue?

jingtang10 avatar Sep 23 '22 11:09 jingtang10

This makes sense to me. I assume it will also be important to pair the astericks * with instructions that say required question. We are planning to test this in an upcoming usability study to learn if people are familiar with what * means.

From a UX perspective I recommend making the * the same color as the question text. In an error state it can be red to indicate that a response is missing to a required question.

shelaghm avatar Sep 23 '22 18:09 shelaghm

@Manikant25 Any updates would you like to share on it?

santosh-pingle avatar Sep 26 '22 06:09 santosh-pingle

Looking into it.

santosh-pingle avatar Sep 28 '22 06:09 santosh-pingle

This makes sense to me. I assume it will also be important to pair the astericks * with instructions that say required question. We are planning to test this in an upcoming usability study to learn if people are familiar with what * means.

From a UX perspective I recommend making the * the same color as the question text. In an error state it can be red to indicate that a response is missing to a required question.

@shelaghm Does it require to show * in instructions if required field is true, as it is already being shown in question text? if yes, also is it (* in instructions) required to show in red color if it's in error state?

santosh-pingle avatar Oct 04 '22 07:10 santosh-pingle

I suggest we use words to explain what * means by addingrequired question in the instructions text field.

Screen Shot 2022-10-04 at 10 37 57

Error state should look something like this screenshot. I don't think the asterisk needs to be red in error state, only the instructions text. What do you think? Screen Shot 2022-10-04 at 10 40 29

shelaghm avatar Oct 04 '22 17:10 shelaghm

I suggest we use words to explain what * means by addingrequired question in the instructions text field.

Screen Shot 2022-10-04 at 10 37 57

Error state should look something like this screenshot. I don't think the asterisk needs to be red in error state, only the instructions text. What do you think? Screen Shot 2022-10-04 at 10 40 29

@shelaghm what about instructions which get defined in questionnaire form? currently existing implementation only shows instructions if it is defined in questionnaire form.

santosh-pingle avatar Oct 06 '22 05:10 santosh-pingle

yeah agreeing with santosh we need to resolve this question: if there's already an instruction do we override it? or do we show both?

late to the party, but my experience as a user (i think mostly with html web forms) has been that the asterisk is always red. i think this is consistent with google forms too:

Screenshot 2022-10-07 at 11 59 04

jingtang10 avatar Oct 07 '22 11:10 jingtang10

  1. I'm convinced, let's make the asterisk red
  2. If there's already an instruction, I think we should show original instructions and display the error message below.

Rationale for 2 is an assumption that it will make it easier for users to know how to complete the question by showing the instructions and that we cannot rely on that the questionnaire builder to write an error message that will include comprehensive enough info. Do you agree with this assumption or have a different perspective? @santosh-pingle @jingtang10

Examples Screen Shot 2022-10-07 at 11 58 43

Example that instruction text can be used for more than just basic instructions Screen Shot 2022-10-07 at 11 59 55

shelaghm avatar Oct 07 '22 19:10 shelaghm

@jingtang10 @shelaghm @santosh-pingle I would advocate for the asterisk to also be in red. Most web forms and mobile forms use the red asterisk to denote required fields.

This would be easy to use for users since they are already used to it in the different apps and web forms they interact with.

dubdabasoduba avatar Oct 10 '22 15:10 dubdabasoduba

@dubdabasoduba Thanks for your feedback, helpful to hear your experience! Red asterisk it is!

shelaghm avatar Oct 10 '22 22:10 shelaghm

@aditya-07 commented that when there's no question text, having an asterisk is very strange. i think @shelaghm and @santosh-pingle agree.

@shelaghm please advise how to proceed - we could either use flyover when there's no question text. or we can just add another line (maybe similar to the instructions) to explicitly say "Required".

jingtang10 avatar Nov 11 '22 13:11 jingtang10

I recommend using the flyover/ label text field to display the asterisk. Ideally also include *required in the help field/entry format field below the text box. This follows the Material design recommendations.

Screen Shot 2022-11-11 at 15 21 17

shelaghm avatar Nov 11 '22 23:11 shelaghm

looking into it.

santosh-pingle avatar Dec 06 '22 05:12 santosh-pingle

@shelaghm Some views does not have flyover attribute to show * in the view e.g boolean choice, single choice, multiple choice... Any thought how can we show asterisk in those views? may be instructions text or separate text line?

santosh-pingle avatar Dec 12 '22 10:12 santosh-pingle

@santosh-pingle For all of these (boolean choice, single choice, multiple choice) I think there's a much higher likelihood that they will have a question title as it will be hard for people to know what they are answering without a question title. My recommendation would be to use instructions text field to show required question

Mocking it up, it looks a bit strange with no title, but with instructions showing required question My perspective is that this is an edge case I think developers should avoid and we should encourage the use of question titles :) Screen Shot 2022-12-12 at 07 21 21

shelaghm avatar Dec 12 '22 15:12 shelaghm

@shelaghm @jingtang10

Are we still going to show *required just below the view like

I recommend using the flyover/ label text field to display the asterisk. Ideally also include *required in the help field/entry format field below the text box. This follows the Material design recommendations.

Screen Shot 2022-11-11 at 15 21 17

@shelaghm @jingtang10 We had offline discussion in one of the internal developer call, where Jing, Omar and other internal developers discussed whether it is required to show *required text when * is shown in the flyover text, we did not have concrete conclusion yet, but you can help us to conclude on it.

santosh-pingle avatar Dec 14 '22 05:12 santosh-pingle

@santosh-pingle Yes, show *required below.

In our usability testing we found that most participants either didn't notice or didn't know what the * means. So I recommend always showing *required when there is a * This is also consistent with material.io guidance

shelaghm avatar Dec 14 '22 07:12 shelaghm

can we just say required then without using *?

i feel asterisk is a shorthand for required when explained at the beginning of the questionnaire, if people don't understand it and we have to explain it every time, we might as well just simply say required every time without using asterisk.

jingtang10 avatar Dec 15 '22 14:12 jingtang10

@jingtang10 This is a good point. Hadn't considered removing the * until now. My only hesitancy is that many people are familiar with what * means and would expect to see it? But maybe it doesn't matter as it will reduce visual clutter and using the word required is much more meaningful. I'm open to removing the * and only using required instead. @jingtang10 What do you think? Any risk in removing the asterisk?

Why only use required text?

  • Reduce the # of elements in the form. Having both * and required is redundant and makes the form look more cluttered.
  • The explanation required is more helpful and meaningful to people than just an *
  • * is meaningless to many people without the explanation, so why include to begin with

Why both * and required text?

  • Even though we tested this with new or some experience internet users in Nigeria, other people might be more familiar with the * as a pattern to indicate required than those we tested it with
  • The * is a common pattern across web forms and many expect it
  • Having the * symbol is a quick way to notice if it is required

shelaghm avatar Dec 22 '22 22:12 shelaghm

Thanks @shelaghm for the writeup!

First of all let me say, if (and I'm not saying that I necessarily think this is the right approach) we do add * and required, I don't think * needs to appear twice. At the moment it's added after the question text e.g Name * and then before required i.e. *required just below the question. This doesn't make sense to me. Having * required is an explanation of what * means at the beginning of the form like a graph legend. I think if we add the text required each time the * is present we should just do required and that's enough.

So now, the question becomes, do we add * after the question text. I think I'm much more open to having it if it's not repeated twice. Let's just do this?

jingtang10 avatar Dec 23 '22 10:12 jingtang10

Ahh, got it. @jingtang10 I think this is a good approach.

In conclusion: Keep * after the question text . But in hint text remove *required and just say Required Screen Shot 2022-12-27 at 12 22 50

@santosh-pingle we've made a decision on this issue so you can continue the implementation.

shelaghm avatar Dec 27 '22 20:12 shelaghm

also just confirming that we don't want to show the asterisk in red anywhere right? just following the question text color.

jingtang10 avatar Jan 05 '23 12:01 jingtang10

@jingtang10 Yes, that's right. A few participants in the usability study were confused and thought since it was red that it meant there was an error. So I recommend changing it to same color as the text string to reduce confusion and not associate it with the error color.

shelaghm avatar Jan 05 '23 17:01 shelaghm

cool thanks for confirming @shelaghm @santosh-pingle fyi

jingtang10 avatar Jan 06 '23 11:01 jingtang10