Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Question Prototype0:51 with Andrew Chalkley
This is how I built my Question prototype.
In this video, I'll show you how I tackle the question prototype.
Here's my question.
I have a constructor function that takes in the text of the question and
array of choices and the correct answer.
The choices array has two items.
It has the correct answer and an incorrect answer.
I've also created a method on the question that checks
if the user's choice is the correct answer.
I chose to add a method here, rather than somewhere else in the code,
like in the quiz or the quiz UI, because the question should be the only object
that determines if an answer is correct or not.
How much did your implementation differ from mine?
If you did it differently, that's fine.
There's countless ways of solving a problem.
In the next video, I'll show you how I did my quiz prototype.
You need to sign up for Treehouse in order to download course files.Sign up