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

Athena integration -- opening wrong course #9

Closed
jerrychen109 opened this issue Dec 4, 2016 · 7 comments
Closed

Athena integration -- opening wrong course #9

jerrychen109 opened this issue Dec 4, 2016 · 7 comments

Comments

@jerrychen109
Copy link

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
Copy link
Owner

rianadon commented Dec 5, 2016

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
Copy link
Author

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
Copy link
Owner

rianadon commented Dec 6, 2016

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
Copy link
Owner

rianadon commented Dec 7, 2016

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
Copy link
Author

jerrychen109 commented Dec 7, 2016 via email

@jerrychen109
Copy link
Author

jerrychen109 commented Dec 7, 2016 via email

@rianadon
Copy link
Owner

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.

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

2 participants