Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on Loading #3

Open
SteadyStatus21 opened this issue Apr 26, 2022 · 15 comments
Open

Stuck on Loading #3

SteadyStatus21 opened this issue Apr 26, 2022 · 15 comments

Comments

@SteadyStatus21
Copy link

Hello, I was trying to use the interface, and the console seemed to return the correct information, however the website was stuck on loading. Attached is what I can see. https://steady.likes-throwing.rocks/5uyGJ9xH7

Thanks!

@refact0r
Copy link
Owner

Usually reloading the page fixes this problem. If it still doesn't work, clear cookies for the site and log in again.

@refact0r refact0r closed this as completed May 6, 2022
@yyrichy
Copy link

yyrichy commented Feb 22, 2023

This looks like a promising project. I also have the same issue, reloading, clearing cache, or clearing cookies does not work.

@refact0r
Copy link
Owner

Can you inspect element and show what it says in the console?

@refact0r refact0r reopened this Feb 22, 2023
@yyrichy
Copy link

yyrichy commented Feb 22, 2023

Screenshot 2023-02-21 at 9 34 00 PM

@yyrichy
Copy link

yyrichy commented Feb 22, 2023

Screenshot 2023-02-21 at 9 35 15 PM

Stuck here forever

@refact0r
Copy link
Owner

Ok, seems like an issue with getting the current period.
Can you go to this branch deploy https://log-period-dates--gradenight.netlify.app/, open the console, and screenshot it again?
Please expand the first object's periodDates array and all the array elements, like this:
image

@yyrichy
Copy link

yyrichy commented Feb 22, 2023

Screenshot 2023-02-22 at 1 18 18 PM

here it is. It doesn't print in console until I reload after logging in

@refact0r
Copy link
Owner

Oh, that's strange. Seems like your district has 7 grading periods but only gradebook data for 4 of them?
I'm not sure I see a link between the listed period dates and the gradebook data.

@refact0r
Copy link
Owner

So 2 solutions for this scenario:

  1. default to first grading period on the homepage
  2. add extra api call to fetch current gradebook (might make loading slower)

@yyrichy
Copy link

yyrichy commented Feb 23, 2023

Oh, that's strange. Seems like your district has 7 grading periods but only gradebook data for 4 of them? I'm not sure I see a link between the listed period dates and the gradebook data.

It seems in your code you are only fetching the gradebook data for the first 4 one by one: (gradenight/src/routes/login/+server.js)
Screenshot 2023-02-23 at 8 00 37 AM
I guess you did this is because your school only has 4 but mine has more

You don't need to add a parameter for the current reporting period. If you leave it blank in the request it should get you all the gradebooks for all the reporting periods

@yyrichy
Copy link

yyrichy commented Feb 23, 2023

So you should be able to only make one client.gradebook() request instead of 4 or however many reporting periods

I see that you're using the official studentvue.js library, but you might want to look at https://github.com/EGGaming/studentvue.js I use it and it does the annoying soap request parsing for you
Documentation

@refact0r
Copy link
Owner

refact0r commented Feb 23, 2023

It seems in your code you are only fetching the gradebook data for the first 4 one by one

You're right. I forgot about that.

You don't need to add a parameter for the current reporting period. If you leave it blank in the request it should get you all the gradebooks for all the reporting periods

Ok thanks, I will try this.

I see that you're using the official studentvue.js library, but you might want to look at https://github.com/EGGaming/studentvue.js I use it and it does the annoying soap request parsing for you

I will stick to the current implementation for now, as switching would require a lot of rewriting. Thanks for the recommendation.

@refact0r
Copy link
Owner

So you should be able to only make one client.gradebook() request instead of 4 or however many reporting periods

I've taken a look at this, and it seems making the request without a parameter will just cause it to return the current gradebook, not all of them.

@yyrichy
Copy link

yyrichy commented Mar 20, 2023

Hmm yeah it seems you are correct. I think I wrote that without realizing you needed all of the gradebooks. If you want to support different schools having a different amount of reporting periods I guess you would have to get the current gradebook, then use that to get all the reporting periods, then get all the gradebooks

But thats if you want to get all the gradebooks at once. I haven't looked at your code closely but couldn't you retrieve the current gradebook then retrieve the rest on demand, like when the user selects a different reporting period from a dropdown? Or maybe you need all of them at the start for data

@refact0r
Copy link
Owner

Late reply, but yes, I think that would work. Due to the slow speed of fetching I would probably would fetch the current gradebook first and then load the rest in the background. I don't plan on actively working on this project right now, but in the future I might consider rewriting most of it to support this. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants