Skip to content

Conversation

DiegoOTdC
Copy link
Collaborator

@DiegoOTdC DiegoOTdC commented Aug 25, 2020

What is this about?
We need a quiz page that either shows the multiple choice questions in level 1 or the open questions (where users need to write some code themselves as answer) in level 2.

How is it made?
I created a new page that, on first loading, takes the params.id and dispatches 2 different actions to the backend.
-getCompletedExercises in store/user
-getExerciseById in store/exercise

Then when this data is loaded, through the use of useEffect a forEach function will search the completedExercise and inside we use the find function on the allCurrentExercises to figure out if the user already finished these exercises or not.

The first exercise the user has not finished, will be set in localState and then send to either the QuizCards component or QuizCode component depending on whether or not if this exercise is level 1 or level 2, respectively.

Copy link
Collaborator

@DarianRushworth DarianRushworth 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, well done. Great Logic throughout easy to read 10/10

Copy link
Collaborator

@StephBerg86 StephBerg86 left a comment

Choose a reason for hiding this comment

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

Nice!

@DiegoOTdC DiegoOTdC merged commit 063d851 into development Aug 26, 2020
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