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

feat: add initial support for more advanced game settings #179

Merged
merged 19 commits into from
Mar 4, 2024

Conversation

dustin-jw
Copy link
Contributor

@dustin-jw dustin-jw commented Feb 28, 2024

Description

This is the first step towards building a more complex game selection process that will eventually involve timers, a results page, and more fine-tuned options for people studying. This work focuses on allowing users to pick multiple categories to study at once.

To Validate

  1. Make sure all PR Checks have passed
  2. Pull down this branch
  3. Run npm start
  4. Click through the Flash Cards, Short Answer, and Multiple choice quick start links, confirming that you go straight to a question page with "Question 1 of n", where n is less than or equal to 50
  5. The subheading should list the category or categories that the question belongs to, separated by commas
  6. If you click through to the last question, there should be a link that leads to the game settings page for the game type you're playing
  7. Go to the game settings page for Flash Cards, Short Answer, and Multiple Choice, checking the following for each:
    1. By choosing no categories and pressing the "Start Game" button, you start the game with all questions
    2. By choosing one or more categories (other than "All Questions"), you only see questions in those categories
    3. By choosing categories with overlap, like "Assistive Technologies" and "Screen Readers", the number of questions indicated by the "Start Game" button matches the number of unique questions, not the sum of the category totals
    4. When JavaScript is disabled, the "Start Game" button still takes you to a question, but the order won't be randomized, and it will be all questions

Copy link

netlify bot commented Feb 28, 2024

Deploy Preview for triviaccessibility ready!

Name Link
🔨 Latest commit cfdcff5
🔍 Latest deploy log https://app.netlify.com/sites/triviaccessibility/deploys/65e1f9058e87860008341164
😎 Deploy Preview https://deploy-preview-179--triviaccessibility.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dustin-jw dustin-jw marked this pull request as ready for review March 1, 2024 15:37
@arnest00 arnest00 self-requested a review March 1, 2024 17:34
@arnest00
Copy link

arnest00 commented Mar 1, 2024

Screenshot 2024-03-01 at 1 39 13 PM

Acknowledging I don't have the user testing to back this up, I don't think it would be unclear to the user what toggling "All Questions" would mean for a game even if the action does not change the state of any categories that might have already been chosen. Especially since the question total is repeated in both the "All Questions" label and the "Start Game" button. It does differ from the common pattern of the "all" option clearing them, though.

I'm back and forth on it.

We could replace "All Questions" with "select all" and "clear all" actions but lose the visual on how many questions there are in total unless we place that elsewhere. The default state of the game setup screen would also have fourteen checked checkboxes, which I'm not a fan of.

We could have "All Questions" checked by default - "Start Game (153 Questions)" - and change the result when it is unchecked - "Start Game (0 Questions)." I'm averse to disabling the "Start Game" button in this case, in favor of an error/helper message that says something to the effect of at least one category is required. In this case, checking the "All Questions" would clear any chosen categories, and choosing any single category would uncheck "All Questions."

All that to say, now that I'm typing all that out, that's deserving of a new PR and the behavior we have currently is at a good point for this work.

Copy link

@arnest00 arnest00 left a comment

Choose a reason for hiding this comment

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

This looks great!! Thanks for all your work on this, Dustin.

@dustin-jw dustin-jw merged commit 3d424c1 into main Mar 4, 2024
6 checks passed
@dustin-jw dustin-jw deleted the feat--advanced-gaming branch March 4, 2024 15:13
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