Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #96
I modified Turtle.tsx and LessonSide.tsx in order to make the turtle's dialogue box display a randomized statement with every new exercise.
In Turtle.tsx, I changed the props to take a number rather than a string, and also changed the labelling of the different dialogue IDs from strings to numbers. This was needed in order to create an efficient way to pick random dialogue. To go along with these modifications, I also had to change LessonSide.tsx to set TurtleID as a randomTurtleMessage, which is gathered from an additional function called getRandomNumber, which takes in a range of numbers that correspond to the amount of dialogues there are to choose from. It then returns that random number and sets the randomTurtleMessage to it, thus setting the TurtleID to a random dialogue. There are no new dependencies that are required for this change.
Test Plan
In order to test my code, I made sure to run through the website in play multiple times to see if the Turtle Dialogue box on the side would change for each exercise. It works upon refreshing the page, when moving to a new exercise, as well as when navigating back and forth within exercises.
Start of Website
Finished Exercise 1, onto Exercise 2
Go back to Exercise 1
Refreshing the Website