rianadon / CheckPCR

A client for PCR, the homework system formerly used by The Harker School
MIT License
8 stars 3 forks source link

Athena integration -- opening wrong course #9

Closed jerrychen109 closed 7 years ago

jerrychen109 commented 7 years ago

Clicking the course name in the cards is opening the wrong course; could potentially be the way you're extracting them from the Athena integration data but not sure.

rianadon commented 7 years ago

Thank you for reporting this, but I'm not able to reproduce this myself, so I'm not sure what could be going wrong.

Therefore, when you have the time, please try the following:

  1. Open the developer console, and execute console.table(athenaData). You should see a table of courses names, links, and periods.

    • Do the periods and class names match up?
    • Try visiting the links. Do they match up with the classes?
  2. Execute the following:

    console.table(JSON.parse(localStorage.athenaDataRaw).body.courses.sections, ["section_title", "link"])
    • This should output a table of period numbers and links. Do the links match up with the period numbers?
jerrychen109 commented 7 years ago

Nope, the periods and class names don't match up, but the links match with the periods. I'm guessing it's probably a relatively unique issue caused by A. that I have a couple courses stuck from last year because one of the teachers left and the other is teaching something else now and B. that all juniors have an extra advisory course made to share stuff to the entire Class of 2018. I'll check with a couple other juniors to see if they have similar issues.

rianadon commented 7 years ago

Hmm I also have a few courses from last year and an extra advisory course, but nevertheless that still could be related.

Try running the following:

c=JSON.parse(localStorage.athenaDataRaw).body.courses;console.table(c.courses,["course_title","nid"]);console.table(c.sections,["course_nid","link"])

This should print out two tables, one of class names and nids, and another of links and course_nids.

Basically, the data retrieved from pasting in that large chunk of data into the settings page is divided into two parts: courses (which include the course name) and sections (which contain the link), and the links of courses are found by stitching the courses and sections together via these ids that should match each other.

Once you get the output, try visiting the outputted links and see if their course_nids match the nids for the corresponding classes. If they don't, is their any kind of pattern to their discrepancy?

Thanks for helping debug this!

rianadon commented 7 years ago

Before you go to the effort of following the instructions above if you haven't already, did you paste the data from Athena into the welcome page or into the settings page?

A while ago I think the same thing was happening and I updated the algorithm in the code run by the settings page, but not the code run by the welcome page, which maintained its own copy of the same algorithm.

jerrychen109 commented 7 years ago

Hm, I think I pasted it into the welcome page. I’ll try pasting it into the settings page and seeing what happens.

On Tue, Dec 06, 2016 at 10:07 PM rianadon

< mailto:rianadon notifications@github.com

wrote:

a, pre, code, a:link, body { word-wrap: break-word !important; }

Before you go to the effort of following the instructions above if you haven't already, did you paste the data from Athena into the welcome page or into the settings page?

A while ago I think the same thing was happening and I updated the algorithm in the code run by the settings page, but not the code run by the welcome page, which maintained its own copy of the same algorithm.

You are receiving this because you authored the thread.

Reply to this email directly, https://github.com/rianadon/CheckPCR/issues/9#issuecomment-265364201 , or https://github.com/notifications/unsubscribe-auth/ALkOX6F410CO234XggvsBmZ83_cneJ8Vks5rFk0PgaJpZM4LDu6Z .

jerrychen109 commented 7 years ago

Yup, that fixed it. Thanks!

On Tue, Dec 06, 2016 at 10:08 PM Jerry Chen

< mailto:Jerry Chen jerrychen109@gmail.com

wrote:

a, pre, code, a:link, body { word-wrap: break-word !important; }

Hm, I think I pasted it into the welcome page. I’ll try pasting it into the settings page and seeing what happens.

On Tue, Dec 06, 2016 at 10:07 PM rianadon

< mailto:rianadon notifications@github.com

wrote:

a, pre, code, a:link, body { word-wrap: break-word !important; }

Before you go to the effort of following the instructions above if you haven't already, did you paste the data from Athena into the welcome page or into the settings page?

A while ago I think the same thing was happening and I updated the algorithm in the code run by the settings page, but not the code run by the welcome page, which maintained its own copy of the same algorithm.

You are receiving this because you authored the thread.

Reply to this email directly, https://github.com/rianadon/CheckPCR/issues/9#issuecomment-265364201 , or https://github.com/notifications/unsubscribe-auth/ALkOX6F410CO234XggvsBmZ83_cneJ8Vks5rFk0PgaJpZM4LDu6Z .

rianadon commented 7 years ago

Okay cool! Thank you for all of your help.

I'll fix the error on the welcome page as soon as I can get around to it.