scottBowles / xmas2022

https://auntsusanschristmas.vercel.app/
0 stars 0 forks source link

Challenge Page #18

Closed scottBowles closed 1 year ago

scottBowles commented 1 year ago

The page for an individual challenge.

The url is set to be /challenge-set/{challengeSetId}/challenge/{challengeId}.

We'll probably want the page to look different for different challenge types, so for this issue let's not worry about that. This should just take care of getting the challenge's data loaded for the page, and should handle answer submission. For the last challenge, it should have a button that makes it clear that submitting this will complete the whole challenge set. We may want to allow users to jump around between challenges in the challenge set, in which case we'll need good navigation for that.

  1. The user should only be able to see a challenge after it has started. Otherwise it should 404.
  2. The user should only be able to see a challenge if they have a started challenge set response for this challenge set (which will start their timer).
  3. If the user has a completed challenge set response for this challenge set, they should either not be able to see this page (be redirected to the review page), or this should be a review page for this challenge. If this is what we do, the user should not be able to submit, and it should be clear that the page is static, just showing the challenge, correct answer, user's answer, whether it was deemed correct.
  4. If the backend gets a form submission, it should ensure that the user's challenge set response for this response has been started and has not been completed. It'll probably do validation. It'll probably also do some normalization (e.g., making the response all lowercase so we don't have to account for unnecessary variation in our accepted responses). On a valid submission, it should direct to the next challenge in the challenge set. If it's the last challenge in the challenge set, after saving the response it should complete the challenge set response (set the completedAt property to the current time). It's possible we should do this with something we pass from the frontend rather than checking whether it's the last on the backend. When this happens and the player's challenge set response is completed, we should redirect to the challenge set review.
scottBowles commented 1 year ago

Working on this on branch challenge-page

scottBowles commented 1 year ago

Closed by #19