ScottyLabs / course-api

The new version of the Scheduling API, now with prerequisites, course descriptions, and more!
https://scottylabs.org/course-api/
MIT License
20 stars 14 forks source link

Associated Lectures/Sections #58

Open pilleye opened 5 years ago

pilleye commented 5 years ago

For classes that have large lectures, the JSON data makes lectures and sections completely independent of one another similar to the following,

"lectures": [
  {
    "instructors": [
      "Kaynar, Zeliha Dilsun",
      "Cervesato, Iliano"
    ],
    "name": "Lec 1",
     "times": [
        {
          "begin": "09:00AM",
          "building": "DH",
          "days": [
            2,
            4
           ],
           "end": "10:20AM",
           "location": "Pittsburgh, Pennsylvania",
           "room": "2315"
      }
    ]
  }, ...
]
...
"sections": 
[
  {
    "instructors": [
      "Kaynar, Zeliha Dilsun",
      "Cervesato, Iliano"
    ],
    "name": "A",
    "times": [
      {
        "begin": "09:30AM",
        "building": "GHC",
        "days": [
            1
        ],
        "end": "10:20AM",
        "location": "Pittsburgh, Pennsylvania",
        "room": "CLSTR"
      },
      {
        "begin": "09:30AM",
        "building": "WEH",
        "days": [
            5
        ],
        "end": "10:20AM",
        "location": "Pittsburgh, Pennsylvania",
        "room": "5310"
      }
    ]
  }, ...
]

However, this isn't really an accurate depiction of the courses since if you choose a lecture, there are only a certain number of sections that you have available to you. Would it be a possibility to include an array field of associated sections in the lectures field, where it contains a string array of the sections that are associated with a given lecture if that is the case?

pilleye commented 5 years ago

Also, although the raw file doesn't associate which lecture goes with what section, if you do an empty search on SOC, it'll separate the different sections by lectures, depending on which sections are able to go with what lecture.

This appears to be some sort of issue on CMU's part where the raw data gives us less information than through the SOC. Alternatively, as a fix, someone could implement something similar to how the FCE processing works, and just ask the user to download a copy of the webpage of a blank search so that the system can process it.

justinchuby commented 5 years ago

I think this is achievable using SOC's API that's currently used by course api to retrieve course descriptions. An example usage of the api is https://enr-apps.as.cmu.edu/open/SOC/SOCServlet/courseDetails?COURSE=70122&SEMESTER=S19.

It's used in the get_course_desc function.

https://github.com/ScottyLabs/course-api/blob/77308db5c83f004937f9049702a9eaddeafe8657/cmu_course_api/parse_descs.py#L187-L195