Hello and welcome to the part two of this functionality for the app using JavaScript.
I have added a chunk of code here from line 92 to a hundred and twelve.
This function here will display the current question and the choices so line 94.
I'm doing a console log and I passed it in.
Display core in question.
So when the current question is displayed it will show it on the console on the screen.
Line 96 declare the variable here.
Call question and set it to course two questions and then passed it hand array of current question dot
question.
So that's a high res so you pick up the questions from that array.
We remember we we defined a variable at the very beginning core questions.
Okay.
So we also defined some more variables here.
Line 55 will go a variable called current question and we'll got one called current answer.
So those are the variables is referring to.
All right.
So when you say says variable question equals two questions which is that variable.
And it's past it current question.
Got a question variable.
Question class again equals two.
Do you see a dollar sign.
J.
Query in close to this method.
Again he picks up the.
This is the container contained under wraps it not quiz container.
If say if this quiz container is greater than the question then 98 ways of choices.
The variable code choices again.
If that method dot quiz is greater than choice list.
These are what the more the various variables have been defined.
And these are the values here.
We're using this here to set the question.
Class.
Okay.
This here is a comment I've just put here.
Question.
Class the text or question.
This will remove all current ally elements.
If there is any.
Okay.
That's what this means.
Choice to find a lie and then remove them here variable one of several variable choice.
Who got a loop here.
Same for high.
If the first value close to zero and the eye is less than the number of choices then increase.
I increase the question by 1.
If the choice is equal to the questions current questions or choices you pass through the eye which
is the represents the I act as a counter who represents 1.
So here again we we're using the dollar sign on this the airline list using the airline is list to impute
a radio button and cancel it to the radio button each time a choice is made and then it appends it to
the list.
OK.
Want to choices is made you appends it to the list.
The final function I've added here is from line one hundred and twelve two hundred and twenty five is
a function called Reset quizzes function will reset the quiz and enable you to start a game.
So the leaves are.
This is what will happen when the quiz is reset.
The current question if the save the current question is close to zero correct is of course to zero
it will hide the score.
It will call this function.
This function is called function or method called high score so it will hide the score and then will
go here.
Another function function called displaced function here would display the score is saying if the document
are fine the quiz container is greater than the result.
The text then it displays this text to see you scored x and x amount plus correctly display what you
do display that text that says you scored plus the correct answers you've answered plus out of question
for example you say you scored five out of is called you scored.
So for example four questions out of eight okay.
That's what that means.
And then it does the same thing and then it shows the results.
Using this show method it shows the results here after I displays that then we've got a function called
Hide score.
This will use a document of fine result and it will hide the results.
So all these functions will be used at various parts of the code.
So that's all the code for the functionality for the quiz.
If you have any please let me know.
So these are all the code whether any parts of it you don't understand.
Please let me know.
So last set.
Thanks for watching.
Bye for now.