Project brief
Page overview
Brief
- Make a Buzzfeed style personality quiz that tells the user what kind of cake they are based on their results
Concepts used
- Practicing using and storing data in arrays, using loops to access and show the data in a meaningful way
- Choosing the most commonly occuring answer from a set of data
Problems encountered
- I had to account for two answers being chosen the same number of times. I made separate arrays for each different value of chosen answer, and showed the corresponding cake of the first longest array if there was no clear winner
- In my original script, I encountered a bug which cause the last question's value to not be pushed to any answer array. I fixed it by only calling the function to show the winning cake after some checks had been made, to make sure each question's answer value had been pushed.
Take the quiz to find out which flavour of cake matches your personality!
Question 1 of 5
You are: vanilla sprinkle cake! You are caring and always reliable.
You love to help others and enjoy relaxing. Take a break, you deserve it!
Photo by Billy Parisi
You are: chocolate mud cake! You are a social butterfly and loyal to your friends and family.
You like genuine conversations and staying up late.
Photo by Dr Oetker.com
You are: lemon poppyseed cake! You have a sunny disposition and are very creative.
You always try to bring the best out of every situation or person you meet.
Photo by Del's Cooking Twist
You are: carrot cake! You are driven and outgoing.
You love to explore new places and always give 100%. You always toast to health!
Photo by NYT Cooking