So the users are able to do decrease, also get final score, the dates of persons are stored in local
storage, and now it's time to display the results on admin panel in the results released.
So the data should be appeared here on the right side of admin panel.
All right.
Let's do it for that.
As usually we have to create a new method.
This function will be the part of UI controller module.
So let's write it up to final results method and call it at the results on panel.
Then use your anonymous function.
This function will receive one parameter, which actually will represent person local authority, so
let's call it user data.
So function is created, let's go to control and module and invoke it.
Right here, UI controller.
That ad result on panel.
So, as we said, we need your personal local storage as an argument at first before we use it, we
need to make personal local storage object public.
So let's go to Chris controller module.
Here we have a person, local storage object, let's copy it.
Then inside return statement.
Create new property and call it get person local storage.
And then paste you the name of person, local storage object.
Then go back to controller module and insert as an argument.
Cruise control dogs, jasperson, local Starbridge.
All right, so to display results, an admin panel is going to be very simple to do, and you already
know everything in order to reach that goal.
So before I show you how to do it, I recommend to try it on your own, because I'm sure that you won't
have any trouble with that.
Just for the hint, you can use known insert adjacent HDMI method in order to display the result list.
So pulls the video and go ahead.
All right, I hope you have done it, but anyway, I will show you my solution.
So the first thing that we have to do is to create a new variable in which we will store the content
for personal results.
Let's name it as results HTML.
After that, I'm going to select an element from a simple document which actually wraps each person
results.
So here we have deep elements, which has the class name results released wrapper.
Let's copy it.
And then in dump items object.
In admin panel section, create new property and call it results list rapper.
Then selected right document that query selector.
And paste the class name ResultSet, this rapper.
All right, because of that, we are going to create a result list on each function invocation, we
need always to have results, at least reparenting.
So let's go back to that result on panel function and write down items that result lists rapper.
And I'm going to use your property.
Which should be equal to three.
In order to display the relevant date of person, we have to iterate through them so far that we have
to create for loop.
Right here, very close to zero.
Then as a condition, we have to compare eye to the length of personal data in local storage, right.
User data that gets personal data.
That length and then a plus plus.
OK, now it's time to create a of content for personal results.
Let's go to a file again inside deep elements we have here commented the line of code.
It consists of several elements we have here paragraph disparate elements, which actually contains
text for final results.
And also here is a button elements for deleting the result from result list.
Let's copy it.
And then.
Assign it to result a variable inside for a loop place here, empty single quotes and then paste XHTML
content.
In this age of content, there are few things to change in order to make them dynamically changeable.
At first, let's change the class names for P and spot elements.
Both of them have person dash one.
So let's delete those numbers and place here the variable ie instead of them.
As I default, we have here full name of user as Nick Smith, so let's change it and.
Gets actual first name and last name, a person as a first name, let's place your.
Plus, user data.
That gets personal data then in square brackets, right eye, and then that first name.
Then copy it.
Paste and change, first name into last name.
All right, the next that we have to do is to change the score of person as I default, we have here
56, let's delete it.
And instead of this number.
Right.
Plus user data.
Don't get personal data.
Then the variable I.
Dr. Scott.
And the last thing that we're going to do is to change idea of button element, we want to be those
platen elements to have unique IDs in order to delete and the relevant personal results for that, we
have to assign to it person ID.
So right here.
Plus, user data that's got personal data.
Then again, I.
Then dogs.
All right, we're almost done.
The only thing that is left to do is to display this content on the result list and for that, I'm going
to use again, insert adjacent HDMI method.
So.
Right, Dom items dot.
Results released the rapper.
Then right adjacent ASML.
As a physician, I'm going to place year after Biggin.
And then as a second argument, let's place your result, HDMI.
OK, it's time to test how all of this stuff works.
Let's go to Browsr at First Log-in as admin in order to prepare some questions.
I'm going to do it quicker, so let's type here something.
Then logging as user rights, for example, McDo.
And so the questions.
Then finish the quiz.
So we have here final results and now let's check again admin panel logging as John Smith and you see
that on the right side in a result list there is added the result of anecdote.
So which result of another user will be added here as well after finishing the quiz?
All right, perfect.
That's it for this video, using a couple of lines of code, we got really great results.
So now admin is able to see and serve the results of users or maybe students.
OK, let's move on.