Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Survey Aesthetics #124

Merged
merged 4 commits into from
Apr 28, 2021
Merged

Survey Aesthetics #124

merged 4 commits into from
Apr 28, 2021

Conversation

cassidysymons
Copy link
Collaborator

@cassidysymons cassidysymons commented Apr 27, 2021

  1. On new_participant.jinja2, there are two groups of changes:
    1a) Not all fields that are required were actually shown as required to the user - I standardized that
    1b) The asterisk for required fields was breaking onto a new line - I formatted it to be red and show up on the same line with cleaned-up visuals

  2. On survey.jinja2:
    2a) I paginated the form by field group
    2b) Added buttons for Previous & Next Section
    2c) Added a progress bar to the top of the screen
    2d) Add a one-time confirm on submit since responses can't be edited
    2e) Made some font weight and size changes to decrease the wall-of-text effect

(note, depends on biocore/microsetta-private-api#315)

Copy link
Member

@wasade wasade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @cassidysymons! Two general requests, can variables be declared for use relative to their scoping needs? And second, would it be possible to use strict equality (===) on conditionals?

microsetta_interface/templates/survey.jinja2 Outdated Show resolved Hide resolved
microsetta_interface/templates/survey.jinja2 Outdated Show resolved Hide resolved
microsetta_interface/templates/survey.jinja2 Outdated Show resolved Hide resolved
@wasade
Copy link
Member

wasade commented Apr 27, 2021

From interactive review:

The confirm window unexpectedly shows only once. I selected "Submit survey", then clicked "cancel", and then reclicked "submit survey". The second "submit survey" click proceeded without the confirmation window.

Would it be possible to default the selection as Unspecified on the radio buttons and if easy, to do so for the dropdowns?

Any particular reason the alcohol levels have a pulldown but the other selections don't (see attached screenshot)?

Screen Shot 2021-04-27 at 9 01 09 AM

@cassidysymons
Copy link
Collaborator Author

The confirm window unexpectedly shows only once. I selected "Submit survey", then clicked "cancel", and then reclicked "submit survey". The second "submit survey" click proceeded without the confirmation window.

That was an intentional decision to make it fairly unobtrusive - essentially, just a one-time "Hey, you can't edit this, do you want to go back and check it?" If you think it will be confusing to users, I can change it to continue showing up until the users hits OK.

Would it be possible to default the selection as Unspecified on the radio buttons and if easy, to do so for the dropdowns?

For some reason, the createDefaultObject function in VFG doesn't seem to actually populate default values. I see two options here:

  1. Add a custom JavaScript function after the form is generated to walk through the form and choose the "Unspecified" option for any radio button and dropdown. My main concern is that if people see a question already answered, they might be less likely to change it, as there's a behavioral bias towards leaving default answers in place.
  2. Eliminate the "Unspecified" option altogether since people have the implicit option to just not answer any given question. However, I'm unsure if this would be something that would require approval and/or introduce any sort of statistical issues in new surveys vs old surveys?

Any particular reason the alcohol levels have a pulldown but the other selections don't (see attached screenshot)?

That question has seven possible answers, so it falls just outside of the criteria for changing to a radio button. We can move that limit around however we want, choosing six was fairly arbitrary in that it seemed like a manageable number of options.

@wasade
Copy link
Member

wasade commented Apr 27, 2021

Thanks! For the confirmation window, that makes total sense, do you think it would be nice to note in the window this message will only appear once?

For Unspecified, I like option 2 except for the situation where a person selects a response and then decides they don't want to answer the question anymore. Is there a non terrible way to allow someone to unselect a radio button while also eliminating unspecified?

I agree with the behavior bias concern on 1.

Ah I see where the limit occurs now, thanks. Would it be possible to bump it +1? I think that gets the alcohol question and one other. It does wrap around on small form factor devices, but that's true at six too

@@ -118,6 +118,11 @@
width: 80%;
margin: 0 auto;
}

.required-field {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a bunch of the spans use class="red right required-field", I'm guessing class red just sets color: red. Should we bundle the definition of right into here also, then we can just set class="required-field" everywhere and drop the red and right classes from all the spans?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "red" and "right" classes were already in the code but didn't appear to be doing anything. I added the required-field class to handle the aesthetic changes I was making, but left red and right in place in case there was some legacy reason for them that I was unaware of.

If there's no reason to keep them, I'd be happy to clean them all out and just keep required-field.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, so spans are required-field, divs are red right required-field? I think my question is can we drop the red class from the divs (assuming the right class does something else we want that isn't covered)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, both the red and right classes can be dropped from the divs. Neither class is defined anywhere in the CSS and I don't see any JavaScript that uses them. If neither you nor @wasade know of any reasons to keep them, I can drop both and just leave required-field in place.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say drop them then, if nothing shifts around or changes color, we're in the clear

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just dropped all of the references to the red and right classes and standardized all of the asterisks to . I double-checked after the change and nothing was altered visually, either in color or positioning.

@wasade
Copy link
Member

wasade commented Apr 27, 2021 via email

Copy link
Contributor

@dhakim87 dhakim87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great change, the pagination code is very clear and the css changes on the vue elements look good as well.

@@ -5,11 +5,60 @@
<script type="text/javascript" src="/static/vendor/js/vue-2.5.17.min.js"></script>
<script type="text/javascript" src="/static/vendor/vue-form-generator-2.3.4/vfg.js"></script>
<link rel="stylesheet" type="text/css" href="/static/vendor/vue-form-generator-2.3.4/vfg.css">
<style type="text/css">
.vue-form-generator .field-radios .radio-list label {
Copy link
Contributor

@dhakim87 dhakim87 Apr 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that this catches labels in groups of radio buttons, should similar style be set for groups of checkboxes?

(See Do you eat a specialized diet ? (select all that apply), Step 2 of 7 in the Microsetta Participant Survey)

Rough guess on the css selector is:
.vue-form-generator .field-checklist .dropList .list-row label

Could be a separate change entirely though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you thinking you'd want to have the checkbox options span the entire width of the screen (similar to radio buttons), rather than in a one-per-line dropdown?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhakim87 is this a blocking item or can this be sorted out later?

Removed the superfluous red and right classes, and standardized all of the red asterisks to <span class="required-field">*</span>
Fixed variable scoping and switched to strict equality conditionals
@cassidysymons
Copy link
Collaborator Author

I updated the variable scoping and switched to strict equality conditionals - let me know if I missed anything on either of those fronts.

I also added a line to the confirmation box saying that it will only appear once.

As far as the Unspecified side of things, there's really no simple way to deselect a radio button once the user has selected it. It's possible to do via JavaScript, so we could theoretically add a button to each field to clear selections, but that's neither cleaner for the user, nor from the standpoint of code maintinability.

I can definitely see the issue in users not having a way to deselect a field after answering, whether due to erroneously clicking or deciding they prefer not to answer. Let me think about this topic a bit and circle back to it later, I feel like there's some sort of middle ground in making the "Unspecified" option both more useful and more graceful but I'm not seeing it at the moment.

@wasade
Copy link
Member

wasade commented Apr 27, 2021

Thanks, @cassidysymons!! Sounds good on the unspecified item -- let's table it for now. I'll re-review this evening

@wasade
Copy link
Member

wasade commented Apr 28, 2021

I'm +1, will merge after hearing on the open comment with @dhakim87

@wasade wasade merged commit 165b60c into biocore:master Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants