-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/multiselect repo selection quiz #138
Conversation
…h more than 2 options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'm going to approve since I'm not sure if this is on a deadline, if so we can make separate issues.
Side note, if you select "Yes" for question 1, it feels like you should be able to click "Back" to select a different answer, but then I realized you don't actually go to a new "page" when you've "finished" the quiz, that's why it's still greyed out. I'm not sure if this needs to be fixed, maybe we can wait for more feedback.
</div> | ||
<br /> | ||
|
||
{q.options.length > 2 && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works based on the questions that we have now, but it seems possible that they could want a radio form with more than two options or a checkbox form with 2 options. So it may be worth the extra effort to make this more flexible in the future. On the vlmd quiz, I added an extra key to the questions to define what type of form the question should be ("single-choice", "multi-choice", etc)
disabled={Object.keys(selectedCheckboxes).length === 0} | ||
style={{ marginTop: "10px", color: "white" }} | ||
> | ||
See Repositories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This button seems like it should be a toggle for a dropdown (or maybe an actual dropdown / accordion component should be used). You click it once and it presents the information, but if you click it again it does nothing. At the very least, I think the button should be hidden or disabled after the first click.
This PR adds a multi-select question using checkboxes to the Repository Selection Tool. The logic checks to see if the number of options (previously 2 for all questions since they were yes/no), is greater than 2. If so, it renders a multiselect question that looks like this:
When presented with the multi-select, users can either select options, or click the "None of the Above" button, which takes them to the next question. If the users select some of the check boxes, the "None of the Above" button is disabled (side note: I like this UI feature, but, one draw back is that if they accidently clicked the checkboxes, they have to uncheck them all to click "none of the above", so please let me know your feedback on this!). When they are done, they can click "See Repositories" which displays a list of their relevant repositories, which they can then download, as can be seen below:
I think there may be potential edge cases in the UX that could be addressed, but overall, i think it works as expected. Feedback, questions, and concerns are welcome!