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

Feature/multiselect repo selection quiz #138

Merged
merged 11 commits into from
Feb 5, 2025

Conversation

suejinkim20
Copy link
Collaborator

@suejinkim20 suejinkim20 commented Jan 7, 2025

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:

screencapture-localhost-3000-repository-decision-tree-2025-01-07-14_55_57

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:

screencapture-localhost-3000-repository-decision-tree-2025-01-07-14_56_05

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!

@suejinkim20 suejinkim20 requested review from mbwatson and Woozl January 7, 2025 20:04
Copy link
Collaborator

@Woozl Woozl left a 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 && (
Copy link
Collaborator

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
Copy link
Collaborator

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.

@suejinkim20 suejinkim20 merged commit 64286f7 into staging Feb 5, 2025
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.

2 participants